Converting html to pdf

There are lots of expensive solutions available that are cross-platform.

1 Like

wkhtmltopdf works fine for me with macOS and Windows on both desktop and web, but there is no iOS version (thankfully there is an iOS workaround from @Jeremie_L ).

2 Likes

I have use wkhtmltopdf for all my reporting for the last 12 years. I have the wkhtmltopdf.exe for window and the wkhtmltopdf for Mac on my desktop app components folder.

in the desktop app, I passed over the path for the wkhtmltopdf, all the parameter and the path for html and path for pdf.

From what I read it’s unlikely that there will be an ARM version of Wkhtmltopdf.

planned may be not, but once someone enough motivated needs it, there will be an arm version !
thanks to opensource.

I have heard from MBS that there are required elements of Wkhtmltopdf that preclude it from being fully Open Source due to certain licence restrictions. But it may still get a ‘free’ version.

For those interested: I have a product coming in the next release to fill this need for Desktop, called GraffitiHTMLtoPDF, and for Web I’ve had a FromHTML method in GraffitiPDF for a decade or more. I know not everyone uses GraffitiSuite, but if you do then you have options. Both are compatible with ARM.

6 Likes

Is the exact same code used on the Web and Desktop version? My use case would require an exact match of the PDF. For example, if the website shows a PDF for the customer to approve and we regenerate on a desktop app, we would need the exact same result.

Same library, yes.

If anyone that has a current GraffitiSuite Desktop subscription would like to try it before release, just open a support ticket.

That looks really interesting. Does the conversion to PDF also work for really crappy html?

I’d have to see an sample and run it through to check, but if it displays in a WebKit browser then it should make it in to the PDF with the exact same appearance. There may be caveats, but I’ve not seen any that I can recall.

I have been testing the comming library from @Anthony_G_Cyphers , and I must say that this is very promising, all of my testcases worked fine.

2 Likes

This is very exciting: thanks for what sounds like yet another valuable contribution to the Xojo community.

2 Likes