Generate PDF based on HTML

Hello. I have some HTML stored in a variable. How can I generate a PDF based on this HTML?

Hi, you sure can.
You can use the Generate HTML action to generate a payload from your variable.
Then use the Convert to Doc action to convert the HTML payload to Google Docs format.
Finally use the Export Doc action to export the newly generate Google Doc to PDF.
Hope that helps.



Even though zenphi does not have a specific action to convert HTML to PDF, you can use a workaround. Use the “Convert to Docs” action to convert an HTML file into a Google Docs and then use a “Export Document” action to convert that document into a PDF. The convert to docs action requires a file in Google drive. You can generate an HTML file using the “Generate HTML” action. You need to create a dummy HTML file in dive with a replacement token {{html_content}} and pass in your variable with the HTML so that it would replace it and create a new HTML file. You can pass the “Payload” output of that action into the “Convert to Docs” action.

We are working on a few PDF actions, and one of them is directly converting HTML to PDF. We will let you know once that is released.

Zenphi also supports advanced document generation. You could template a document with all the styles/images and get zenphi to create a PDF from it.