Hi,
I found a site that lets you create a pdf from a URL for free: https://html2pdf.app
It's quite easy to now create a link to "print" the current page:
<script>
var txt = "Print";
document.write(txt.link("https://api.html2pdf.app/v1/generate?url=" + document.URL + "&apiKey=8fc8992e7ab59463faeffa82343b41a21bb05a1fe5bc2102c52a02e0a171b864"));
</script>
or create a button to print the current page:
<button onclick="easyPrint()">Print</button>
<script>
function easyPrint() {
window.open("https://api.html2pdf.app/v1/generate?url=" + document.URL + "&apiKey=8fc8992e7ab59463faeffa82343b41a21bb05a1fe5bc2102c52a02e0a171b864");
};
</script>
Please note:
- The above API information is taken from the website (and not my API)
- Do NOT use the first script snippet in a rich text field on your page (it breaks the builder!)
- The button could also be a menu item with, in stead of a URL: javascript:easyPrint() (no idea why, but I get a referenceError, easyPrint does not exist)
My main concern, however, is security.
The website apparently is hosted in Lithuania, there are no contact details and there are no privacy or other policies in effect. Also, it is not possible to delete your account.
All red flags.
What do you think? Is it worth pursuing this option or is it just unsafe?
Thank you for your opinion.
Dennis
P.s. Other direct methods for generating PDF's are appreciated. I want to stay away from Integromat/Zapier and especially Webmerge (appr. 1 dollar per document is just ridiculous). The print option is a bit of a hassle and confuses clients