Docx to pdf conversion distorts header on writer

Hello,

I am trying to convert a docx to pdf on an Ubuntu headless server. The original docx is written in Aptos font.
I have installled aptos on server at /usr/share/fonts/truetype/aptos/*.ttf. The main problem comes when converting the docx to pdf, the header font size is changed and distorts it severely.

Resultant header in pdf


In the original one, the fields Document, Version and Date are with font size equal to the page field and thus it fits in one line… The fields in the original docx file are mergefields automatically filled by an external program before performing the pdf conversion…

The conversion is executed with the command:

soffice --headless --convert-to pdf:writer_pdf_Export

Any hint on what can I change to avoid this behaviour??
Any help is very much appreciated!!

regards!

DOCX has no character style. Therefore any formatting involving font size adjustment is done with direct formatting. There are no page styles either. Depending on how you formatted the raw header and what the external program did, you can diverge a lot from your expected result after conversion from DOCX to internal format before exporting to PDF.

Could you attach a single page sample exhibiting the header?

Thanks for the repsonse,

the external program just fills the fields with values, does not affect formatting. The file sent to pdf conversion is exactly this one

PC001B000ICA01A.docx (39.1 KB)

Thanks once more!

From what I see, fields DOC_CODE, DOC_REV, CREATEDON` and page number are all set at 10pt, while all labels and field “statistics” (page count) are at 8pt.

Was the screenshot above taken from Draw? This is hinted by the dotted borders around text boxes. Draw is not a PDF reader and does not always correctly interpret PDF encoding. Have you checked with a real PDF reader (such as Okular under KDE Plasma or Evince under Gnome)?

Generally speaking, the whole document is direct formatted. I would also question the use of a table in the footer where ordinary paragraphs would do the job the same and be more efficient.

Of course, that is a bug. The font size, explicitly defined for the text in the problematic cells, is lost on import. It is unrelated to installed fonts, operating system, headless mode, or mail merge.

It seems the style configuration of the header (it was configured as 10 pt font size) somehow distorts the pdf onversion (eventhough the paragraph is set at 8 pt). I have changed the style to 8 pt and now the header is printed correctly.

Thanks a lot for your time and help!!