How to convert HTML files (stored in assets) to image in android?
<p>I'm trying to convert html files stored as assets to image so that I can share them. I tried the following code: </p>

<pre><code>Picture picture = webView.capturePicture();
Bitmap b = Bitmap.createBitmap(
        picture.getWidth(), picture.getHeight(), Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(b);
picture.draw(c);

FileOutputStream fos = null;
try {
    fos = new FileOutputStream( Environment.getExternalStorageDirectory().toString() +"/temp.jpg");
    if ( fos != null ) {
        b.compress(Bitmap.CompressFormat.JPEG, 100, fos);
        Toast.makeText(SyllabusPage_NW.this, "created", Toast.LENGTH_SHORT).show();
        Intent sharingIntent = new Intent(Intent.ACTION_SEND);
        Uri screenshotUri = Uri.parse(Environment.getExternalStorageDirectory().toString() + "/temp.jpg");

        sharingIntent.setType("image/jpeg");
        sharingIntent.putExtra(Intent.EXTRA_STREAM, screenshotUri);
        startActivity(Intent.createChooser(sharingIntent, "Share image using"));
        fos.close();

    }
}
catch( Exception e ) {

    Toast.makeText(SyllabusPage_NW.this, "Error", Toast.LENGTH_SHORT).show();
}
</code></pre>

<p>The result of this is attached and the expected result is also attached. The webview captures only the first part of the html page.
I wanna know how I can capture the entire html page instead of just the first bit?</p>

<p><a href="https://i.stack.imgur.com/1aJUR.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1aJUR.jpg" alt="Image that I&#39;m getting"></a></p>

<p><a href="https://i.stack.imgur.com/eVCHH.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eVCHH.jpg" alt="The Image I&#39;m expecting"></a></p>