Android Question HTML to PDF - Offline - <page_break_inside: avoid>

MMORETTI964

Member
Licensed User
Longtime User
We've a need trying to convert HTML document to PDF.
I know, there is a way to convert HTML to a bitmap (using a webview) and then convert in PDF (like an image).
However we need some more control over PDF created (for example using page_break_inside: avoid). Obviously this is not possible passing through a bitmap.
In some other context (iOs) we use library like BNHTMLPDFKIT who give the ability to transform HTML to "real" pdf (not an image).
As far as you all know, there is a way to get this result from B4A? Even, seems there are no library to wrap from Android world?

Many thanks in advance.
Maurizio
 

MMORETTI964

Member
Licensed User
Longtime User
Thank you @Erel

How can I pass html string to pdfDocument?
I can't traduce html to pdf.Canvas.DrawText because html was passed from external sources (it's not hardcoded in app).

Thank you.
Maurizio
 
Upvote 0

MMORETTI964

Member
Licensed User
Longtime User
We've tried but with PrintHtml open a windows, the user should manually select "PDF", ...
We need to make it programmatically.

So, we will make a library to get the result as a single operation like:
HtmlToPdf("my.html","my.pdf")

Thank you for support.
Maurizio
 
Upvote 0
Top