How to convert XWalkView page to image?
<p>I am using Crosswalk library instead of regular WebView. I need to print receipt in printer where I send bytes. For this purpose I want to convert page to image then send print it out. This is what I tried:</p>

<pre><code>public void onLoadFinished(XWalkView view, String url) {
    super.onLoadFinished(view, url);
    Log.d(TAG, "Load Finished:" + url);

    View v = view.getRootView();
    v.setDrawingCacheEnabled(true);
    Bitmap b = Bitmap.createBitmap(v.getDrawingCache());
    v.setDrawingCacheEnabled(false);

    FileOutputStream fos = null;
    try {
        fos = new FileOutputStream( "/sdcard/"  + "page.jpg" );
        if ( fos != null ) {
            b.compress(Bitmap.CompressFormat.JPEG, 90, fos );
            fos.close();
        }
    }
    catch( Exception e ) {
        System.out.println("-----error--"+e);
    }
}
</code></pre>

<p>I am getting this:
<a href="https://i.stack.imgur.com/p1MLl.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/p1MLl.jpg" alt="enter image description here"></a></p>

<p>How to capture page to image?</p>