fix groovy x/y scale barcode rendering

This commit is contained in:
Jörg Prante 2021-12-09 18:53:32 +01:00
parent 10a401731f
commit 49332d85d5
3 changed files with 6 additions and 6 deletions

View file

@ -231,7 +231,8 @@ class ParagraphRenderer implements Renderable {
float width = barcode.width
float height = barcode.height
PdfBoxGraphics2D pdfBoxGraphics2D = new PdfBoxGraphics2D(pdfDocument.pdDocument, width, height)
BarcodeGraphicsRenderer renderer = new BarcodeGraphicsRenderer(pdfBoxGraphics2D, null, 1.0d,
BarcodeGraphicsRenderer renderer = new BarcodeGraphicsRenderer(pdfBoxGraphics2D, null,
1.0d, 1.0d,
java.awt.Color.WHITE, java.awt.Color.BLACK, false, false)
renderer.render(symbol)
renderer.close()

View file

@ -92,8 +92,8 @@ class PdfBoxBarcodeTest {
BufferedImage bufferedImage = new BufferedImage(width as int, height as int, BufferedImage.TYPE_BYTE_GRAY)
Graphics2D g2d = bufferedImage.createGraphics()
Rectangle rectangle = new Rectangle(0, 0, width as int, height as int)
BarcodeGraphicsRenderer renderer = new BarcodeGraphicsRenderer(g2d, rectangle, 1.0d,
Color.WHITE, Color.BLACK, false, false)
BarcodeGraphicsRenderer renderer = new BarcodeGraphicsRenderer(g2d, rectangle,
1.0d, 1.0d, Color.WHITE, Color.BLACK, false, false)
renderer.render(code3Of9)
renderer.close()
PDImageXObject img = LosslessFactory.createFromImage(document, bufferedImage)
@ -120,8 +120,8 @@ class PdfBoxBarcodeTest {
void create(float x, float y, float width, float height, Code3Of9 code3Of9) {
PdfBoxGraphics2D pdfBoxGraphics2D = new PdfBoxGraphics2D(document, width, height)
Rectangle rectangle = new Rectangle(0, 0, width as int, height as int)
BarcodeGraphicsRenderer renderer = new BarcodeGraphicsRenderer(pdfBoxGraphics2D, rectangle, 1.0d,
Color.WHITE, Color.BLACK, false, false)
BarcodeGraphicsRenderer renderer = new BarcodeGraphicsRenderer(pdfBoxGraphics2D, rectangle,
1.0d, 1.0d, Color.WHITE, Color.BLACK, false, false)
renderer.render(code3Of9)
renderer.close()
PDFormXObject xFormObject = pdfBoxGraphics2D.getXFormObject()

View file

@ -67,7 +67,6 @@ public abstract class TestUtils {
assertEquals(expectedFrags.size(), actualFrags.size());
}
@SuppressWarnings("serial")
public static class Template extends LinkedList<Object> {
public Template(Object[] lines) {
Collections.addAll(this, lines);