HTML String to pdf

Help Desk ›› How to ›› HTML String to pdf
6 November, 2020 16:42:16
QuietGamer
Topics: 3
Messages: 3
Hi, there,

I need convert an HTML string in PHP code into pdf and allow user to view it as it is rendered in browser. What is the best way to do it?

The string is simply a table and user data in the table.

Thank you!
6 November, 2020 18:54:12
E2Pdf
Support
Topics: 7
Messages: 3335
Hi,

You can try to use "e2pdf_model_shortcode_e2pdf_user_response" filter which must be added to your themes functions.php to output custom data.

Example: https://codeshare.io/aneJBY

Shortcode inside E2Pdf Template will be like:
[e2pdf-user id="current" key="custom_output"]

It will output "test" if key in shortcode set as "custom_output"

Let us know please if such solution can work for you.

We remain at your service.
We would really appreciate your feedback at WordPress.org!