Forum


Replies: 6   Views: 2121
Docx to pdf conversion on windows server with 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  · 03-11-2020 - 06:30

Hello,

If the problem comes from the IIS web server, then you need to set correct rw access to the temp folder. Please note you can create a custom temp folder (for example in C:\inetpub\wwwroot\temp\libreoffice) and use it when calling the conversion plugin based on LibreOffice:

1. Create a temp folder where the IIS user has full access, this will be used as temp folder. For example, create the folder C:\inetpub\wwwroot\temp\libreoffice and set to the temp and libreoffice folders full access to the IIS user. Right click on the folder => Security => set and apply full access to the user (IUSR is the default one).

2. In path in config/phpdocxconfig.ini set:

path = '"C:\Program Files\LibreOffice\program\soffice.exe" -env:UserInstallation=file:///C:/inetpub/wwwroot/temp/libreoffice'

setting the correct soffice path and the path to the created temp folder of your server.

3. Now, you can do the conversions using PHP CLI mode and web browser setting the outdir option:

$docx->transformDocument('transformDocument_libreoffice_1.docx', 'transformDocument_libreoffice_1.pdf', 'libreoffice', array('outdir' => 'C:\inetpub\wwwroot\phpdocx-premium-10\examples\FormatConversion\transformDocument\libreoffice'));

These instructions have been fully tested in IIS web server, please follow them step by step and setting the correct paths in your server.

Regards.