Forum


Replies: 9   Views: 8597
Generate pdf out of docx file - problem with html
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 qwerty  · 20-09-2011 - 10:37

Hello!

I'm using the Pro version and am trying to generate a PDF out of a .docx file.

The generation of the .docx file works fine.
I am using $docx->addHTML()

But when i try to generate a PDF, I only get a blank page.

Even if i use the demo and add HTML to the docx file, it is not shown in the pdf.

Is that a bug or am I doing something wrong?

Also, how do I add header and footer parts to the pdf?
They are shown in the .docx, but not in the pdf

Thanks!

Best
Malte

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

Hello,

Seems there're something missing, please enable debug mode on conf/log4php.properties and check LOG file.

Regards.

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

hi there

here is my debug output:

[code]Wed Sep 21 07:47:29 2011,173 [10838] INFO phpdocx_error - Create a temp file to use as initial ZIP file. DOCX is a ZIP file.
Wed Sep 21 07:47:29 2011,275 [10838] INFO phpdocx_error - Add break to word document.
Wed Sep 21 07:47:29 2011,443 [10838] INFO phpdocx_error - Embed HTML to word document.
Wed Sep 21 07:47:29 2011,444 [10838] INFO phpdocx_error - Add break to word document.
Wed Sep 21 07:47:29 2011,894 [10838] INFO phpdocx_error - Embed HTML to word document.
Wed Sep 21 07:47:29 2011,894 [10838] INFO phpdocx_error - Add break to word document.
Wed Sep 21 07:47:30 2011,081 [10838] INFO phpdocx_error - Embed HTML to word document.
Wed Sep 21 07:47:30 2011,081 [10838] INFO phpdocx_error - Add break to word document.
Wed Sep 21 07:47:30 2011,275 [10838] INFO phpdocx_error - Embed HTML to word document.
Wed Sep 21 07:47:30 2011,275 [10838] INFO phpdocx_error - Add break to word document.
Wed Sep 21 07:47:30 2011,448 [10838] INFO phpdocx_error - Embed HTML to word document.
Wed Sep 21 07:47:30 2011,448 [10838] INFO phpdocx_error - Add break to word document.
Wed Sep 21 07:47:31 2011,145 [10838] INFO phpdocx_error - Embed HTML to word document.
Wed Sep 21 07:47:31 2011,145 [10838] INFO phpdocx_error - Add break to word document.
Wed Sep 21 07:47:32 2011,333 [10838] INFO phpdocx_error - Embed HTML to word document.
Wed Sep 21 07:47:32 2011,334 [10838] INFO phpdocx_error - Add break to word document.
Wed Sep 21 07:47:32 2011,334 [10838] INFO phpdocx_error - Add break to word document.
Wed Sep 21 07:47:32 2011,584 [10838] INFO phpdocx_error - Embed HTML to word document.
Wed Sep 21 07:47:32 2011,585 [10838] INFO phpdocx_error - Set DOCX name to: summary.
Wed Sep 21 07:47:32 2011,590 [10838] DEBUG phpdocx_error - DOCX is a new file, not a template.
Wed Sep 21 07:47:32 2011,590 [10838] INFO phpdocx_error - Add _rels/.rels content to DOCX file.
Wed Sep 21 07:47:32 2011,590 [10838] INFO phpdocx_error - Add docProps/app.xml content to DOCX file.
Wed Sep 21 07:47:32 2011,603 [10838] INFO phpdocx_error - Add docProps/core.xml content to DOCX file.
Wed Sep 21 07:47:33 2011,068 [10838] INFO phpdocx_error - Add styles to styles document.
Wed Sep 21 07:47:33 2011,069 [10838] INFO phpdocx_error - Add word/styles.xml content to DOCX file.
Wed Sep 21 07:47:33 2011,076 [10838] INFO phpdocx_error - Add settings to settings document.
Wed Sep 21 07:47:33 2011,076 [10838] INFO phpdocx_error - Add word/settings.xml content to DOCX file.
Wed Sep 21 07:47:33 2011,076 [10838] INFO phpdocx_error - Add web settings to web settings document.
Wed Sep 21 07:47:33 2011,076 [10838] INFO phpdocx_error - Add word/webSettings.xml content to DOCX file.
Wed Sep 21 07:47:33 2011,076 [10838] DEBUG phpdocx_error - Check for a valid license.
Wed Sep 21 07:47:33 2011,077 [10838] DEBUG phpdocx_error - It isnt a macro, generate a new override
Wed Sep 21 07:47:33 2011,077 [10838] INFO phpdocx_error - Add [Content_Types].xml content to DOCX file.
Wed Sep 21 07:47:33 2011,077 [10838] INFO phpdocx_error - Add word/numbering.xml content to DOCX file.
Wed Sep 21 07:47:33 2011,077 [10838] DEBUG phpdocx_error - New ID 1 . numbering.xml.
Wed Sep 21 07:47:33 2011,077 [10838] DEBUG phpdocx_error - New ID 2 . theme/theme1.xml.
Wed Sep 21 07:47:33 2011,077 [10838] DEBUG phpdocx_error - New ID 3 . numbering.xml.
Wed Sep 21 07:47:33 2011,077 [10838] DEBUG phpdocx_error - New ID 4 . webSettings.xml.
Wed Sep 21 07:47:33 2011,077 [10838] DEBUG phpdocx_error - New ID 5 . fontTable.xml.
Wed Sep 21 07:47:33 2011,078 [10838] DEBUG phpdocx_error - New ID 6 . settings.xml.
Wed Sep 21 07:47:33 2011,078 [10838] DEBUG phpdocx_error - There is a word rels, add it.
Wed Sep 21 07:47:33 2011,078 [10838] INFO phpdocx_error - Add word/_rels/document.xml.rels content to DOCX file.
Wed Sep 21 07:47:33 2011,082 [10838] DEBUG phpdocx_error - Remove existing template tags.
Wed Sep 21 07:47:33 2011,082 [10838] INFO phpdocx_error - Add word/document.xml content to DOCX file.
Wed Sep 21 07:47:33 2011,083 [10838] INFO phpdocx_error - Add font to fontable document.
Wed Sep 21 07:47:33 2011,084 [10838] INFO phpdocx_error - Add font to fontable document.
Wed Sep 21 07:47:33 2011,084 [10838] INFO phpdocx_error - Add font to fontable document.
Wed Sep 21 07:47:33 2011,084 [10838] INFO phpdocx_error - Add word/fontTable.xml content to DOCX file.
Wed Sep 21 07:47:33 2011,089 [10838] INFO phpdocx_error - Add theme to theme document.
Wed Sep 21 07:47:33 2011,089 [10838] INFO phpdocx_error - Add word/theme/theme1.xml content to DOCX file.
Wed Sep 21 07:47:33 2011,090 [10838] INFO phpdocx_error - End of file, close it.
Wed Sep 21 07:47:33 2011,096 [10838] INFO phpdocx_error - Copy DOCX file using a new name.
[/code]

here the code i use

[code]
[...]
$docx->createDocx('summary');
require_once WWW_ROOT.'files'.DS.'phpdocx'.DS.'classes'.DS.'TransformDoc.inc';
$document = new TransformDoc();
$document->setStrFile($_SERVER['DOCUMENT_ROOT'] . 'app/webroot/export/summary.docx');
$document->generatePDF();
[/code]

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

Hello,

Please contact us (http://www.phpdocx.com/contact)

Regards.

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

heya!

i contacted you last week but have not heard since!
Are you guys looking into my problem?

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

Hello,

We have answered you by email.

Regards.

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

Can you post the answer?

Posted by suyog.kale@anzu.org  · 28-04-2014 - 07:03

Used Sample code to generatePDF, it creates PDF files but has following problems:



- Header and footer is missing.



- Images from main contents are missing



- bullets list style is missing - all contents displayed as plain text



Please help me to resolve this issue.



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



$docx = new CreateDocx();



$document = new TransformDoc();

$document->setStrFile('E:\XAMPP\htdocs\AnzuConnect\fileconverters\outputs\85687\110.docx');

$document->generatePDF('C:\Users\suyog\Desktop\Text.pdf');



 


Posted by jorgelj  · 28-04-2014 - 09:24

Hello,



If you're using PHPDocX PRO+, Corporate or Enterprise versions, we recommend you to read these pages:



http://www.phpdocx.com/help/conversion-plugin-docx-to-pdf



http://www.phpdocx.com/documentation/pdf-conversion-plugin-installation-guide



Regards.