Export as pdf specific page of specific spreadsheet of a ods document in headless mode

Hi my name is criss, I have a problem trying to export an specific page of an specific spreadsheet of a calc document.

e.g.

the spreadsheet name is “comprobante de pago”

and I want to export only page 5 as pdf of this spreadsheet.

when I try to export I only have the option to export all the pages of the selected spreadsheet

or to export as pdf an specific page counting all the documents spreadsheets pages.
“absolute reference of the entire document”

As this spreadsheet is at the end of the document, the total number of pages of this document will vary eventually when more data is provided in the spreadsheets in the beging of this doc, so will the couting of pages.

I want to export only the page 5 of the specific “Comprobante de pago” spreadsheet. “relative reference from the spreadsheet”

I want to do that with an script in my Ubuntu bash shell in headless mode.

Cause afterward I pretend to send this pdf through email using Evolution headless too. “If you can guide me where to find information of this part of my project I will appreciate it!”

Please help me out!

Usually my suggestion would be to select the area you need before (manual) export. But as you wish also to

there is no selection.
.
So I’d usually insert a copy of the needed data as first sheet, then print only the new page 1. Other options may be print-ranges or a macro, wich can select first, then export…

Thanks for answering, I tried this code:

soffice --convert-to ‘pdf:calc_pdf_Export:{“PageRange”:{“type”:“string”,“value”:“2-2”}}’ ‘LIBRO DE CUENTAS.ods’

and it works… but as I mentioned before it works with all the doc pages counting.

tried to add a selection as:

soffice --convert-to ‘pdf:calc_pdf_Export:{“PageRange”:{“type”:“string”,“value”:“2-2”};“Selection”:{“type”:“Any”,“value”:“Comprobante de pago”}}’ ‘LIBRO DE CUENTAS.ods’

but this won’t work!

Quite creative, but creativity is useless when using a command-line-interface. Usually you “select” with a mouse, and with command-line there is no selection.
.

Therefore I recommended to create a situation, where you know the needed page, and have it not moving with other content, so put it in front.

1 Like

Yes at the end of the day I had to move this spreadsheet to the beginning of the doc. Hope there is a solution to this problem in the future.