Replies: 5   Views: 3342
Generatepdf - lists/tables
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 garyhillerson  · 23-07-2012 - 20:22

New user. I'm creating Word docx files from simple HTML -- with a bullet list, a table, and a number list -- just fine.

However, when I try to generate a PDF from the same HTML, the bullet list shows up with no bullets, the table doesn't look like a table, and the number list isn't numbered. I must be missing a step?

I'm using this PHP code ($htmlDoc is the source HTML):
$tmpFileName = 'gtemp1';
$docx = new CreateDocx();
$docx->createDocx($tmpFileName); // Automatically appends .docx to the file name
$document = new TransformDoc();
$document->setStrFile($tmpFileName . '.docx');
$document->setStrOutputFile($fileName . '.pdf');

And the PDF has paragraph breaks, but no list/table formatting

Any suggestions appreciated


Posted by admin  · 11-04-2013 - 12:13


We recommend you to use PRO v2.5 + conversion plugin, that has several improvements.


Posted by garyhillerson  · 11-04-2013 - 12:13

I am using the latest Pro+Converter. Just bought and installed it last week.

Posted by garyhillerson  · 11-04-2013 - 12:13

Unfortunately, the plugin is not generating any output.

I changed the code to:
$docx = new CreateDocx();
$text = "Here's some text to put into the file";
$paramsText = array( 'b' => 'single', 'font' => 'Arial' );
$docx->addText($text, $paramsText);
$docx->transformDocx('gTemp1.docx', 'gTemp1.pdf');
echo("JUST GENERATED PDF FILE gTemp1.pdf");

The file gtemp1.docx gets created, but no .pdf document is created anywhere on my server.

SAME THING happens when i run the phpdocx/examples/advanced/Transform.php example program. It generates the docx file, but no pdf file is generated anywhere.

Please help.

Posted by admin  · 11-04-2013 - 12:13


First you must start OpenOffice using this command:

soffice -headless -accept="socket,host=,port=8100;urp;" -nofirststartwizard

and then you can transform documents using TransformDocAdv.