Skip to content

Commit b6acc82

Browse files
pachecosfSwati4star
authored andcommitted
fixes #551 - issue with pdf to image
1 parent a1e0634 commit b6acc82

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/src/main/java/swati4star/createpdf/util/PdfToImages.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package swati4star.createpdf.util;
22

33
import android.graphics.Bitmap;
4+
import android.graphics.Canvas;
5+
import android.graphics.Color;
46
import android.graphics.pdf.PdfRenderer;
57
import android.net.Uri;
68
import android.os.AsyncTask;
@@ -61,6 +63,9 @@ else if (mPath != null)
6163
// generate bitmaps for individual pdf pages
6264
Bitmap bitmap = Bitmap.createBitmap(page.getWidth(), page.getHeight(),
6365
Bitmap.Config.ARGB_8888);
66+
Canvas canvas = new Canvas(bitmap);
67+
canvas.drawColor(Color.WHITE);
68+
canvas.drawBitmap(bitmap, 0, 0, null);
6469
// say we render for showing on the screen
6570
page.render(bitmap, null, null, PdfRenderer.Page.RENDER_MODE_FOR_DISPLAY);
6671

0 commit comments

Comments
 (0)