From 29ec10fb663523c4a18904c332199ce6e974dd2f Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Wed, 27 Nov 2013 10:05:35 +0100 Subject: Support for QR Placeholders in PAdES --- .../java/at/gv/egiz/pdfas/stmp/itext/ITextStamper.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'stamper/stmp-itext/src/main/java/at') diff --git a/stamper/stmp-itext/src/main/java/at/gv/egiz/pdfas/stmp/itext/ITextStamper.java b/stamper/stmp-itext/src/main/java/at/gv/egiz/pdfas/stmp/itext/ITextStamper.java index ff68dcd8..b0801a9c 100644 --- a/stamper/stmp-itext/src/main/java/at/gv/egiz/pdfas/stmp/itext/ITextStamper.java +++ b/stamper/stmp-itext/src/main/java/at/gv/egiz/pdfas/stmp/itext/ITextStamper.java @@ -2,6 +2,7 @@ package at.gv.egiz.pdfas.stmp.itext; import at.gv.egiz.pdfas.common.exceptions.PdfAsException; import at.gv.egiz.pdfas.common.settings.ISettings; +import at.gv.egiz.pdfas.lib.impl.placeholder.SignaturePlaceholderData; import at.gv.egiz.pdfas.lib.impl.stamping.IPDFStamper; import at.gv.egiz.pdfas.lib.impl.stamping.IPDFVisualObject; import at.gv.egiz.pdfas.lib.impl.status.PDFObject; @@ -444,7 +445,7 @@ public class ITextStamper implements IPDFStamper { } public byte[] writeVisualObject(IPDFVisualObject visualObject, PositioningInstruction positioningInstruction, - byte[] pdfData) throws PdfAsException { + byte[] pdfData, String placeholderName) throws PdfAsException { try { ITextVisualObject object = null; @@ -479,14 +480,21 @@ public class ITextStamper implements IPDFStamper { throw new PdfAsException("The provided page (=" + positioningInstruction.getPage() + ") is out of range."); } - + + if(placeholderName != null) { + ITextStamperAccess.replacePlaceholder(stamper, targetPage, placeholderName); + } + PdfContentByte content = stamper.getOverContent(targetPage); PdfPTable table = object.getTable(); + logger.info("Visual Object: " + visualObject.getWidth() + " x " + visualObject.getHeight()); + //PdfTemplate table_template = content.createTemplate(visualObject.getWidth(), visualObject.getHeight()); + table.writeSelectedRows(0, -1, positioningInstruction.getX(), positioningInstruction.getY(), content); - + stamper.close(); baos.close(); -- cgit v1.2.3