Under the proposed conditions, one of the conversion options is implemented using a Windows script server (Windows Script Host), a vbs script containing the conversion commands, and generating the necessary command line in php followed by a call.
Sample script call, generated in php:
cscript xls-pdf.vbs <полный путь до файла в формате xls>
For example:
cscript xls-pdf.vbs "D:\07-Проекты\soQu489061 (Конвертация-xls-в-pdf-и-ods)\Excel-PDF-ODS.xlsx"
Vbs script code (name file xls-pdf.vbs )
' ограничения: файл XLS с одним листом ' передаваемые параметры ' Полное Имя Файла в формате XLS ' Полное Имя Файла в формате PDF ' Полное Имя Файла в формате ODS xlsFile = WScript.arguments(0) ' отладка 'MsgBox (xlsFile) arStr = Split (xlsFile, ".") 'отладка 'MsgBox (arStr(0)) pdfFile = arStr(0) & ".pdf" odsFile = arStr(0) & ".ods" ' отладка 'MsgBox (pdfFile) 'MsgBox (odsFile) Set xlsObj = CreateObject("Excel.Application") 'xlsObj.Visible = True Set xlsWrkBk = xlsObj.WorkBooks.Open (xlsFile) xlsObj.DisplayAlerts = False ' 60 - OpenDocument Spreadsheet xlsWrkBk.SaveAs odsFile, 60 ' 0 - PDF xlsWrkBk.ActiveSheet.ExportAsFixedFormat 0, pdfFile, 0, True, False,,,False xlsWrkBk.Close xlsObj.Quit WScript.Quit