Forum


Replies: 1   Views: 626
Docx with comments and tranformdocument or transformdocadvpdf or transformdocadvdompdf
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 Bardehle  · 02-04-2021 - 07:57

Hello,

I'm usind PHPDOCX 10 Premium and would like to transform an existing docx with comments to PDF.
I tried TranformDocument, TransformDocAdvPDF and TransformDocAdvDOMPDF but in all cases I only have "[COMMENT x]" (x = number 1,....) "links" in the generated PDF. These "[COMMENT x]" links are blue and underlined but do not have any action. 

My code:

$outfile = 'test.pdf';
$infile = 'test.docx';

require_once 'CreateDocx.php';
require_once 'dompdf/autoload.inc.php';
$dompdf = new Dompdf\Dompdf();

$transform = new TransformDocAdvDOMPDF($infile);
$transform->setDOMPDF($dompdf);
$transform->transform($outfile);

 

or

$outfile = 'test.pdf';
$infile = 'test.docx';

require_once 'CreateDocx.php';
$docx = new \CreateDocx();

$docx->transformDocument($infile, $outfile, 'native', array('stream' => false));

Am I missing anything?

Thank you

Christian

Posted by admin  · 02-04-2021 - 08:46

Hello,

Comments are not supported in the native conversion plugin (https://www.phpdocx.com/documentation/conversion-plugin/preparing-the-templates-for-its-conversion Supported OOXML tags and attributes when using the native method section), we recommend you using the libreoffice conversion plugin. In the docs folder included in the package you can find how to include the comments to the PDF margins if needed.

phpdocx 12 supports adding comments, footnotes and endnotes at the end of the document using the native conversion plugin.

Regards.