I'm using Android Print Framework to save the HTML Content of the WebView as PDF. Since WebView in Android-L has a new approach to render the WebView content, it is advised to Call enableSlowWholeDocumentDraw() method before creating any webviews. This will disable rendering optimization so WebView will be able to render the whole HTML page.
Here is the part of the Code to Draw WebView into a Canvas.
PdfDocument.Page page = document.startPage(pageInfo);
mWebView.draw(page.getCanvas());
I tried calling WebView.enableSlowWholeDocumentDraw()
from Application, BaseActivity and also right after and before Creating WebView inside my Fragment. But this didn't help.
I tried enabling/disabling Hardware Acceleration by setting the Layer Type as SOFTWARE and HARDWARE but this didn't help as well. I still cannot draw the whole WebView. Only the Visible portion will be drawn to the Canvas.
Has anybody noticed this behaviour ? Is there a solution for that or is this a Bug ?
EDIT
It turns out that it's not about WebView.enableSlowWholeDocumentDraw()
and we are still discussing about the issue. This is the Bug Report. And here is the Sample App to reproduce the issue.