Skip to content

Commit f71f63a

Browse files
committed
PDFBOX-5660: avoid 0, as suggested by copilot
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1933115 13f79535-47bb-0310-9956-ffa450edef68
1 parent 792b87c commit f71f63a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

pdfbox/src/main/java/org/apache/pdfbox/printing/PDFPrintable.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@ public int print(Graphics graphics, PageFormat pageFormat, int pageIndex)
279279
{
280280
float dpiScale = rasterDpi / 72;
281281
LOG.debug("rasterDpi: {}, dpiScale: {}", rasterDpi, dpiScale);
282-
image = new BufferedImage((int)(imageableWidth * dpiScale / scale),
283-
(int)(imageableHeight * dpiScale / scale),
282+
image = new BufferedImage(Math.max(1, (int) (imageableWidth * dpiScale / scale)),
283+
Math.max(1, (int) (imageableHeight * dpiScale / scale)),
284284
BufferedImage.TYPE_INT_ARGB);
285285

286286
graphics2D = image.createGraphics();

0 commit comments

Comments
 (0)