we started using the namespaced premium version of phpdocx 7.5. We use it within a CakePHP project, I copied phpdocx's sources to the vendors folder, setup the classmap path in composer.json and ran composer dump-autoload.
When evaluating the test version, I understood that the conversion plugin was not included. Only know that we bought a license I learned that for using TransformDocAdv (or its decessors) you need OpenOffice or LibreOffice running.
So now I'd like to try to convert with the class TransformDoc, because that seems to be able to do the trick without any external software.
Here is a code snippet:
$transform = new \Phpdocx\Transform\TransformDoc(); $transform->setstrFile('/path/to/source.docx'); $transform->generatePDF('/path/to/dest.pdf');
First I received an error that the class DOMPDF was not found in TransformDoc.inc on line 320. As this class resides in a subfolder of /lib/pdf/, I added that path to the classmap of composer.json and did another composer dump-autoload.
After that I got another error:
Call to undefined function clear_object() in /[…]/phpdocx/lib/pdf/include/frame_tree.cls.php on line 105
Could someone tell me how to configure composer so that all necessary classes/functions can be found?