Skip to content

Commit

Permalink
fix: clean up redundant variable
Browse files Browse the repository at this point in the history
  • Loading branch information
sbplat authored Dec 28, 2023
1 parent 1f10693 commit 1d243a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/stirling/software/SPDF/utils/PdfUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ public static byte[] convertFromPdf(byte[] inputStream, String imageType, ImageT
try (PDDocument document = PDDocument.load(new ByteArrayInputStream(inputStream))) {
PDFRenderer pdfRenderer = new PDFRenderer(document);
int pageCount = document.getNumberOfPages();
List<BufferedImage> images = new ArrayList<>();

// Create a ByteArrayOutputStream to save the image(s) to
ByteArrayOutputStream baos = new ByteArrayOutputStream();
Expand Down Expand Up @@ -232,7 +231,8 @@ public static byte[] convertFromPdf(byte[] inputStream, String imageType, ImageT
writer.dispose();
} else {
// Combine all images into a single big image
BufferedImage combined = new BufferedImage(images.get(0).getWidth(), images.get(0).getHeight() * pageCount, BufferedImage.TYPE_INT_RGB);
BufferedImage image = pdfRenderer.renderImageWithDPI(0, DPI, colorType);
BufferedImage combined = new BufferedImage(image.getWidth(), image.getHeight() * pageCount, BufferedImage.TYPE_INT_RGB);
Graphics g = combined.getGraphics();

for (int i = 0; i < pageCount; ++i) {
Expand Down

0 comments on commit 1d243a0

Please sign in to comment.