Forum


Replies: 5   Views: 243
How to add exportformfields whne converting to pdf using libreoffice
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by admin  · 07-02-2024 - 08:41

Hello,

Thanks for sending more information about your question.

There's no option in phpdocx to set the internal ExportFormFields option available in LibreOffice as false. When the formsfields option in transformDocument is set as true, phpdocx uses the ExportFormFieldsToPdf macro to do the transformation, otherwise the default conversion is done.

We have moved this question to the dev team to consider adding a new option in phpdocx to set ExportFormFields as false in a future release of phpdocx.
To set ExportFormFields as false you could use one of the following approaches:

  • Use the ExportFormFieldsToPdf macro ((macros-libreoffice/macros/Export forms when transforming to PDF.txt) available in phpdocx but changing it to disable this option:
oPropertyDataValue.Name = "ExportFormFields"
oPropertyDataValue.Value =  0
soffice --headless --convert-to 'pdf:writer_pdf_Export:{"ExportFormFields":{"type":"boolean","value":"false"}}' --outdir /path/outputs/ /path/document.docx

Regards.