Checkbox when converted from docx to pdf using swriter (libreoffice) becomes unchecked

All,

Checkbox when converted from docx to pdf using swriter (linreoffice) becomes unchecked.

Here is the command I am using via git bash in Windows.

./swriter.exe --headless --convert-to pdf:writer_pdf_Export --outdir /c/Users/ /c/Users/test.docx
Also see attached before and after conversion.

Try to use one of the new content controls, e.g. Check Box, which are available from version LibreOffice 7.5. They are intended to provide better compatibility with Word respectively docx.


Content Controls in Writer

I am using LibreOffice 7.6. These documents are something we are receiving from users and only control we have is converting it to PDF.

I have attached the docx file with Box checked after converting to PDF I am missing cross on the box. Can anyone help here?
checkbox.docx (15.2 KB)

Duplicated in Can anyone explain why swriter is not converting this checkbox correctly to PDF from docx?

Try disabling creation of forms in PDF export.

Hi @bishowpratap7,

It is important to know which version of LibreOffice you use as well as which operating system you have.

You could also try to open test.docx in writer and see whether the checkboxes are checked, to help deciding if the issue is between docx format and writer, or between writer and exportation to pdf.

I am using LibreOffice 7.6. These documents are something we are receiving from users and only control we have is converting it to PDF.

When I use the PrintToPdf (Windows10 feature) to convert your sample file into PDF file format, the checkbox appeared as “checked” state in the PDF version. But the checkbox is not changeable in the PDF version.
The PDF Export feature of the LO makes the checkbox changeable in the PDF version, but the default is the Unchecked state.
(LO 7.5.7.)

Did we use PrintToPdf feature via command line? Can you point me to some link on how to use this via command line.

Thank You

https://help.libreoffice.org/latest/en-US/text/shared/guide/start_parameters.html

Not. I just used it from the LO menu.

Ok so found the solution to fix this checkbox being unchecked via command line.

Basically we will add an argument with a flag - ExportFormFields":{“type”:“boolean”,“value”:“false”}. What this will tell writer is to convert docx to pdf without editing any form fields but still copy the contents without changing anything on the form (Content Control).

soffice --headless --convert-to ‘pdf:writer_pdf_Export:{“ExportFormFields”:{“type”:“boolean”,“value”:“false”}}’ --outdir /c/Users/ /c/Users/Test.docx

OR

swriter --headless --convert-to ‘pdf:writer_pdf_Export:{“ExportFormFields”:{“type”:“boolean”,“value”:“false”}}’ --outdir /c/Users/ /c/Users/Test.docx