diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2013-11-27 10:05:35 +0100 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2013-11-27 10:05:35 +0100 |
commit | 29ec10fb663523c4a18904c332199ce6e974dd2f (patch) | |
tree | 3d68c52ca1fd5e2cb2f90c1890db22e4fd943dcb /stamper/stmp-itext/src/main/java/at/gv | |
parent | f3476576c50efd922593c82656efda7aec5ae97f (diff) | |
download | pdf-as-4-29ec10fb663523c4a18904c332199ce6e974dd2f.tar.gz pdf-as-4-29ec10fb663523c4a18904c332199ce6e974dd2f.tar.bz2 pdf-as-4-29ec10fb663523c4a18904c332199ce6e974dd2f.zip |
Support for QR Placeholders in PAdES
Diffstat (limited to 'stamper/stmp-itext/src/main/java/at/gv')
-rw-r--r-- | stamper/stmp-itext/src/main/java/at/gv/egiz/pdfas/stmp/itext/ITextStamper.java | 14 |
1 files changed, 11 insertions, 3 deletions
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(); |