Forum


Replies: 1   Views: 4208
Unable to transform document file to pdf
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 butateng  · 10-03-2016 - 16:23

Hi guys, I have an issue using transformDocument.

I created a sample file the I kept on getting an error saying file not found.

Here's my code, any help will be greatly appreciated:

 

        require_once(PHPDOCX_PATH . 'CreateDocx.inc');

        $directory  = $this->directory;
        $tpl        = FCPATH . 'fuel/application/views/presentation/tpl/kit-background.docx';
        $docx       = new CreateDocxFromTemplate($tpl);

        $docx->replaceVariableByText(array('WEBSITE' => 'testing only!'), array('type' => 'block'));
        $docx->createDocx('presentation_sheet');

        $docx->enableCompatibilityMode();
        $docx->transformDocument('presentation_sheet.docx', 'presentation_sheet.pdf');

 

The error says:

A PHP Error was encountered

Severity: Warning

Message: rename(./presentation_sheet.pdf,presentation_sheet.pdf): No such file or directory

Filename: classes/TransformDocAdvLibreOffice.inc

Line Number: 99

Posted by admin  · 10-03-2016 - 20:00

Hello,

It seems the conversion plugin can't generate the PDF file. The most common issue is some missing rw access.

Please follow the steps explained on:

http://www.phpdocx.com/documentation/conversion-plugin/debugging-libreoffice

The 4th point explains the most common rw missing (.config folder).

Which version and license of phpdocx are you using?

Regards.