I have a 13 column xlsx and I want convert to pdf. I use this code: "soffice" ,"--headless","--convert-to", "pdf" , filepath ,"--outdir",outpath. I can convert to pdf but the columns too many so they have been showed on four pages. I need they show on one page. And it show on straight , I need it show on horizontal. Thanks
Asked
Active
Viewed 318 times
1 Answers
0
XLSX printout settings (PDF export) are part of the file contents so here is the same file saved with different settings but same export command. (convert-to implies headless, so not generally needed. The author decides a cell content and shape and also sets how many rows and columns will fit in a standard page such as A4 portrait or A4 Landscape etc. Thus only a macro can change print layout area. The best that may be possible externally is to scale it up or down on to bigger or smaller paper.
soffice --convert-to pdf:calc_pdf_Export "DataTables example Default.xlsx"
soffice --convert-to pdf:calc_pdf_Export "DataTables example A3.xlsx"
You need to change layout for printing and export in the preview screen if you want 13 columns you set area from A:1 to M:Y where Y is your desired number of lines (whatever their variable height may be.)

K J
- 8,045
- 3
- 14
- 36
-
-
Can I add parameters in " soffice -- convert -to pdf:cal_pdf_Export "a3.xlsx" "? – abby_520 Sep 12 '22 at 06:40
-
is there a way to convert only the first sheet to pdf. i have multiple sheets.in that i need to convert only the first one – Prashant Naik Dec 16 '22 at 04:52