Forum


Replies: 3   Views: 3123
Pdf conversion not working
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 geofhoch  · 04-11-2015 - 08:27

Hi,

I bought corporate version and i want to know how to use PDF conversion. I did exactly what the documentation says and it's not working.

I try to run this example :

<?php

require_once '../../../classes/CreateDocx.inc';

$docx = new CreateDocx();

$docx->enableCompatibilityMode();

$text = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, ' .
    'sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut ' .
    'enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut' .
    'aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit ' .
    'in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ' .
    'Excepteur sint occaecat cupidatat non proident, sunt in culpa qui ' .
    'officia deserunt mollit anim id est laborum.';

$paramsText = array(
    'b' => 'single',
    'font' => 'Arial'
);

$docx->addText($text, $paramsText);

$docx->createDocx('example_text');

$docx->transformDocument('example_text.docx', 'example_text.pdf', null, array("debug" => true));

The docx document is created but not the pdf.

I executed the sample file in CLI mode and i have this error :

<b>Parse error</b>:  syntax error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in <b>/home/conferenw/www/classes/CreateDocx.inc</b> on line <b>22</b><br />

Can you help me please ? My customers are waiting for a new feature and i need really the conversion to finish it.

Thank you and sorry for my bad english !