Skip to content

Commit

Permalink
fixes #551 - issue with pdf to image
Browse files Browse the repository at this point in the history
  • Loading branch information
pachecosf authored and Swati4star committed Jan 8, 2019
1 parent a1e0634 commit b6acc82
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/src/main/java/swati4star/createpdf/util/PdfToImages.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package swati4star.createpdf.util;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.pdf.PdfRenderer;
import android.net.Uri;
import android.os.AsyncTask;
Expand Down Expand Up @@ -61,6 +63,9 @@ else if (mPath != null)
// generate bitmaps for individual pdf pages
Bitmap bitmap = Bitmap.createBitmap(page.getWidth(), page.getHeight(),
Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
canvas.drawColor(Color.WHITE);
canvas.drawBitmap(bitmap, 0, 0, null);
// say we render for showing on the screen
page.render(bitmap, null, null, PdfRenderer.Page.RENDER_MODE_FOR_DISPLAY);

Expand Down

0 comments on commit b6acc82

Please sign in to comment.