Create a PDF from Webview on Android

WebView has built-in functionality to generate PDFs which is made available by using PrintManager Service. For your use case, I would suggest you to write/store the final output of WebView’s PrintAdapter which is a PDF file to a local file and go from there.

This link will walk you through the details and implementation.
http://www.annalytics.co.uk/android/pdf/2017/04/06/Save-PDF-From-An-Android-WebView/

You can achieve API level 19(KitKat) compatibility with small tweaks for the above solution.

This should solve your problem but in case you face any issues with the implementation let me know.

Leave a Comment