1
0
mirror of https://github.com/Stirling-Tools/Stirling-PDF.git synced 2024-06-28 21:54:31 +02:00

perf: avoid re-rendering the first pdf page

This commit is contained in:
sbplat 2023-12-27 22:46:55 -05:00 committed by GitHub
parent 1d243a0ca5
commit d405b7a810
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -236,7 +236,9 @@ public class PdfUtils {
Graphics g = combined.getGraphics();
for (int i = 0; i < pageCount; ++i) {
BufferedImage image = pdfRenderer.renderImageWithDPI(i, DPI, colorType);
if (i != 0) {
image = pdfRenderer.renderImageWithDPI(i, DPI, colorType);
}
g.drawImage(image, 0, i * image.getHeight(), null);
}