When using LibreOffice to convert WPS documents to PDF, some text spacing becomes larger, causing the originally single line of text to be split into two lines. However, this spacing issue cannot be modified in the resulting PDF.
Relevant code:
libreoffice --headless --convert-to pdf:writer_pdf_Export abc.pptx --outdir out.pdf
Operating System: Ubuntu 22.04
Analysis of possible causes:
In the graphical interface of LibreOffice, when opening abc.pptx, the displayed result is identical to the incorrect line break in the final PDF. When exporting to PDF, line breaks occur. If you select the line of text, right-click → Paragraph, and uncheck the option “Add spacing between Asian and non-Asian text”, the display will be consistent with WPS, and the export will be normal.
Therefore, the main analysis is that in LibreOffice, there is a default automatic spacing added between Chinese and non-Chinese characters, while WPS does not have this spacing. As a result, files with proper formatting in WPS may have incorrect line breaks in LibreOffice.
Desired outcome:
Since this conversion is intended to be automated, it is not feasible to manually perform operations in the graphical interface every time. Therefore, it is hoped that LibreOffice can either disable this feature by default (currently unable to find a way to disable it), or disable this feature during the conversion output.