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