Hi
What is the correct way to pass 'ExportFormFields=false' when conveting word to PDF using Libre Office?
Thanks
Hi
What is the correct way to pass 'ExportFormFields=false' when conveting word to PDF using Libre Office?
Thanks
Hello,
The formsfields option available in the conversion plugin based on LibreOffice is false as default (https://www.phpdocx.com/api-documentation/format-conversion/convert-Word-docx-into-pdf-with-PHP).
If you want to use this option, you need to add macro in your LibreOffice home folder and enable the option when calling transformDocument.
Please check the macros-libreoffice folder included in the package. In this folder you can read all information about adding and using macros with the conversion plugin based on LibreOffice.
Regards.
Hi
Sorry, I can se tyhat It might not be totally clear what I would like to achive
on the commandline it's possible to have an option ExportFormFields=false, how do I add that when I call the transformDocumnent() method
The problem is that, if there is there are fields - like Document title or author that is inserted, or form fileds then LibreOffice marks the PDF with something called 'NeedAppreance' which intefeer with LTV signing of PDF's
So I need to pass this commandline option in order to ensure that LibreOffice convert the fields ttext
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:
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.
According to this it's
https://help.libreoffice.org/latest/he/text/shared/guide/pdf_params.html?&DbPAR=SHARED&System=MAC
it's supported in the current version, the only thing that is needed is that transformDocument() supports all commandline options.
Hello,
phpdocx supports many LibreOffice options, but some specific options are not supported in the current stable version of phpdocx. If you need to use a not supported option, then you need to call LibreOffice with a custom command. We have moved this topic to the Suggestions board, so the dev team can consider adding this new feature in the stable release of phpdocx.
Regards.