Tuesday, 18 December 2018

How to export a PDF from WebView where I can select text, inside the new PDF

I'm trying to convert WebView's text content to PDF. Using the code below.

PdfDocument.Page page = document.StartPage(new PdfDocument.PageInfo.Builder(webpage.Width, webpage.Height, 1).Create());
webpage.Draw(page.Canvas);

PDF is properly generated but I can't select text from that PDF. Its like WebView content but converted into an image.

But if I try to print same WebView from the print menu and save it as PDF text selection is working and size of the pdf is smaller.

So how can I create PDF from WebView where text is also selectable.

Eg. of text selection.

Sample UI action



from How to export a PDF from WebView where I can select text, inside the new PDF

No comments:

Post a Comment