I have a .xlsx file with an image on header. When i try to convert to PDF via terminal using libreoffice it converts but the image doesn't appear on the generated PDF.
Here is a screenshot of the main .xlsx file on Excel (print mode):
And the Screenshot of the generated PDF:
The command that im using is: soffice --headless --convert-to pdf --outdir /home/output /home/input/headers_footers.xlsx
Note: To display the header image of the .xlsx on excel we need to put it into print view mode (ctrl+p)
I tested the conversion of the headers_footers.xlsx with an online convertion tool to PDF and the final result was as expected: the image appeared.
But i need to do this programatically, so im not sure if its libreoffice or if i need to use other tool, or maybe manipulate the final PDF and add an image on it?
This is not only an UNIX problem. I can reproduce the malfunction running MS Windows 10. The header image appears in print view and in manually exported PDF. But when you call
on command line it won't show up. I will keep on searching for an answer but this seems to be a bug to me.
Is using a LO Basic Macro an acceptable approach for you, too?
When executed this macro exports the spreadsheet to pdf. To run the macro automatically e.g. on file open assign it to "Open Document" in Tools > Customize > Events.
Doing a test by double clicking the xlsx file the image appears in the header of the pdf. However, no success from command line so far.