ONLYOFFICE 7.0: online forms, password protection in sheets, collaboration improvements and much more
ONLYOFFICE 7.0 released

Conversion API Excel to PDF all pages

Hello, Trying to convert an Excel to PDF with the Conversion API, only convert the Current Sheet and not all the document if it has more sheets. In the documentation (ONLYOFFICE Api Documentation - Conversion API) I don’t find any parameter to set the range to “All Sheets”.

Example code:

$URL = $ofiServer . "/ConvertService.ashx";
$vParams = array (
    "key"=>$jobConvert,
    "async"=>false,
    "fileType"=>"xlsx",
    "outputtype"=>"pdf",
    "title"=>$subName,
    "region"=>"es-ES", 
    "url"=>$fileURL,
 
);

Any way to convert all the sheets with the API?
Thanks.

Hello Dataprius.
Thank you for pointing us to this situation. We added a bug to our internal tracksystem (internal number - 54478) and we started working on it.
Workaround solution, please use “spreadsheetLayout” parameter in your request to convert all sheets.

Hello Alexandre, I thought in that too, but, there are no example to know:
How many spreadsheet has the Excel?
How to export the X sheet number?
How can I iterate or know how many sheets an Excel has and later merge all them in only one PDF?
Thanks.

Hello Dataprius.

How many spreadsheet has the Excel?

Please clarify what you mean?

How to export the X sheet number?

Unfortunately, we have not implemented a method for exporting a separate sheet.

How can I iterate or know how many sheets an Excel has and later merge all them in only one PDF?

Do I understand correctly, you want to know the number of sheets in xlsx file? What do you mean by ‘sheet’?

Hello,

I mean, to make a workaround, how could be?
The final objetive is with the API, an Excel with X sheets to be exported to a all its sheets in a PDF. The same way when you export manually from onlyoffice IDE, that you have the option to choose All Sheets, the current Sheet,…
allsheets

In the previous answer yo said that use “spreadsheetLayout” parameter. But I guess that is only valid for the current selected sheet in the Excel.

It’s better that your team can improve the API to set All Sheets mode. Then the export Excel->PDF will be perfect.

In the previous answer yo said that use “spreadsheetLayout” parameter. But I guess that is only valid for the current selected sheet in the Excel.

No, if you set ‘spreadsheetLayout’ parameter, then all sheets will be converted. It’s found bug which I mentioned before and we are working to solve it. Please try to convert xlsx file with this parameter