Using HTML file to output a PDF

前端 未结 2 1202
既然无缘
既然无缘 2021-01-15 15:14

So I\'ve got a HTML file, that I am using to send emails, but in some instances I want it simply to use that file to create a PDF of the same template.

I\'ve got i

2条回答
  •  醉梦人生
    2021-01-15 16:05

    The best option when you want to create a PDF from a template is to use Google Docs directly so that no formatting is lost and also avoid the problem you are facing.

    Why don't you just create your template directly in Google Docs. Have some placeholders such as {name} instead of the actual name. Instead of using template.evaluate(), you can do a find and replace in the doc.

提交回复
热议问题