2022-11-04: updated to mention the command line syntax available since version 7.4.
First of all, you used a wrong export filter name in your command line. As explained here, in this case you (not) needed to use calc_pdf_Export
, which is used by default anyway when you export a document handled by Calc and use pdf
output specification.
But that will not change anything. Until version 6.4, there was no way to do what you need. In 6.4, a Whole sheet export feature was implemented. It has no command-line API (yet? just like any other PDF export setting available in the PDF export dialog); but you may note that whatever settings you set in the dialog in the UI, are saved for following use when you export to PDF directly, and also when you export using command line.
So a simple way would be:
- Install version 6.4;
- Export a spreadsheet to PDF interactively (in UI mode), and in the export dialog, set the mentioned option checked;
- Use the command line you used.
Of course, that would make your export dependent on the export setting defined in the UI, which might be not ideal in case when you use LibreOffice both for batch processing, and interactively on the same box. In this case, you might want the settings used for batch processing to be independent from interactive mode. To do that, you may use -env
command line parameter to specify a separate user profile directory; so starting LibreOffice interactively with the said parameter once to initialize the profile and make necessary filter settings, and then adding that switch to batch processing command line, would allow you to have the necessary customizations independent of your UI usage.
UPDATE 2022-11-04
Starting from v.7.4, it is now possible to define this setting through the command line, without preparing a dedicated profile:
soffice --convert-to 'pdf:calc_pdf_Export:{"SinglePageSheets":{"type":"boolean","value":"true"}}' test.ods
On Windows, single quotes are not accepted in the command line, and internal double quotes in JSON must be escaped, so this becomes
soffice --convert-to "pdf:calc_pdf_Export:{\"SinglePageSheets\":{\"type\":\"boolean\",\"value\":\"true\"}}" test.ods