Replies: 1   Views: 4062
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 . '');

        $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->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/

Line Number: 99

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


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:

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

Which version and license of phpdocx are you using?