Question

Is it possible to integrate dompdf, tcpdf or fpdf into wordpress website to print the pages? If so how can i add this library file into my wordpress website.

Was it helpful?

Solution

There are some limitations to what dompdf can do as far as layout. Though dompdf is working towards browser-class rendering it's not yet there. We generally recommend writing your own script using the class, but you can quickly get started by placing dompdf on your server and using the dompdf.php script. Just place the dompdf directory in the root of your site.

For example, if your site is http://example.com and you place the dompdf files in your root you can render a page to pdf by just linking it as such: http://example.com/dompdf/dompdf.php?input_file=http://example.com/some_page.

The only drawback is that you have to set DOMPDF_ENABLE_REMOTE to true to use this method. See Security Issue on Accessing Remote Image with dompdf for a discussion of potential security concerns. We have a best-practices document in the works which will be posted to the dompdf project wiki when it's ready.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top