Docx to pdf Rich text content control looses formats

I’m using soffice.exe from LibreOffice 7.6.2 to convert a docx filled template to pdf.
While most of the document converts with no issues, all rich text content controls loose format, such as colors, new lines and other styles.

Is this a known issue or “in progress” LibreOffice development?

Thanks.

Does PDF support rich text controls?

The Rich Text is an abandoned, obsolete, never standardized file format of the M$. It had many poorly documented versions and sub-versions…

Which version of the Rich Text format are you using?

@mikekaganski If I open the docx and save as pdf, the controls show properly, so I would say yes.

@Zizi64 it’s not a rich text file. It’s the control from the docx templates.

Sorry, so does LibreOffice export it properly, or does it not?
And please attach a sample document, a PDF with a problem, and a PDF showing it properly.

@mikekaganski Apologies for the confusion. MS Office exported PDF shows as intended. LibreOffice does not. Examples attached.

SourceDocx.docx (20.4 KB)
MSOfficeConversion.pdf (39.6 KB)

@mikekaganski And the LibreOffice conversions.
LibreWriterConvertion.pdf (20.4 KB)
sofficeConversion.pdf (20.4 KB)

MS Word does not export the control to PDF, only its text.
Writer by default exports it as a control - and PDF doesn’t seem to support the rich control, thus the exported control is black.

But if you do not export the PDF as a form with controls - it would export OK, exactly as Word does. Try FileExport AsExport as PDF, and uncheck Create PDF form.

image

If you use command line after that, using the same profile, you will also get the wanted results. You may also use command line to define the setting - see ExportFormFields.

@mikekaganski
Great explanation and solution. Nearly all the issues are gone.
But some seem related to LibreOffice writer itself.
For example, MSoffice opens this docx with newline in the form element.
sourcetest2.docx (41.4 KB)

@mikekaganski here’s the pdf result
sourcetest2MSOffice.pdf (6.6 KB)
sourcetest2LibreWriter.pdf (19.6 KB)