Hi,
for our application we're using the CLI to convert Office documents into PDF's followed by ImageMagick converting those PDF's to preview-images for each page. This is all fine, but for extensive xls-files this results in a very though process.
So I was wondering if it's possible to already restrict the amount of pages to be converted from xls(x) to PDF by Open Office? Off course we have the option to restrict the number of pages via ImageMagick, but the sooner in the process, the better.
Command we're using is : soffice --headless --convert-to pdf --outdir [somedir] [somefile.xlsx]
Thanks in advance
K.
Limit number of pages to convert
-
- Posts: 2
- Joined: Tue Dec 01, 2020 10:27 am
Limit number of pages to convert
LibreOffice 6.3.4.2 30(Build:2)
Ubuntu 18.04.3 LTS
Ubuntu 18.04.3 LTS
Re: Limit nrof pages to be converted
You can load the document and restrict the print area. Then export to PDF and close without saving. I'm not sure if this would work in headless mode.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
-
- Posts: 2
- Joined: Tue Dec 01, 2020 10:27 am
Re: Limit nrof pages to be converted
And this is possible through the CLI?Villeroy wrote:You can load the document and restrict the print area. Then export to PDF and close without saving. I'm not sure if this would work in headless mode.
LibreOffice 6.3.4.2 30(Build:2)
Ubuntu 18.04.3 LTS
Ubuntu 18.04.3 LTS
Re: Limit nrof pages to be converted
It is possible to run the office in some kind of server mode listening on a port. Then you could write a program in Python, Java or Cpp connecting to the office, loading the file, calling the right API for the print area and file export. I have no experience with this kind of stuff. I know that many such programs suffered from memory leaks.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice