Forum


Replies: 2   Views: 5595
Rtf to pdf conversion, shows blank pdf page
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 suyog.kale@anzu.org  · 26-05-2014 - 07:16

Hi,



 



There is bug while converting rtf contents to PDF, Need your help to resolve:



 



We tried with following approach to convert rtf to pdf but the final PDF shows blank page, this  is happening almost with all the rtf files:




  • Create new CreateDocx()

  • Add plain text to docx using $docx->addText($docItem->streamData);

  • Add RTF file using method $docx->addRTF(array('pathRTF' => $current_file));

  • Then save to docx file

  • Then transform docx to pdf using $docx->transformDocx($file,$result,$this->outputFolder);



 



Please find attached sample rtf files.



 



We can’t directly convert RTF TO PDF as we want to add some plain text as start of page and then rtf contents.



 



Regards,



Suyog Kale


Posted by jorgelj  · 26-05-2014 - 09:11

Hello,



As is explained on the documentation these methods: addRTF, addDocx, addMht and a few others can't be used to convert the document to PDF. Because they use tha altchunk tag that is not compatible with the conversion plugin. You can use embedHtml and mergeDocx to add HTML or an existing DOCX to a DOCX.



If you want to use the altchunk tags and transform to PDF you'll need to use the method transformDocxUsingMSWord on a Windows server.



Regards.