aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-pdfbox-2
diff options
context:
space:
mode:
authoremusic <emina.music@egiz.gv.at>2018-03-21 16:56:28 +0100
committeremusic <emina.music@egiz.gv.at>2018-03-21 16:56:28 +0100
commitad3722eeda59cb2bcffa205f6ad8fbb37cf55504 (patch)
treedaed08af2eff0030d5fbd94d910fc3643795bda6 /pdf-as-pdfbox-2
parente49eb5e433767386a09732f5942b6425098b511b (diff)
downloadpdf-as-4-ad3722eeda59cb2bcffa205f6ad8fbb37cf55504.tar.gz
pdf-as-4-ad3722eeda59cb2bcffa205f6ad8fbb37cf55504.tar.bz2
pdf-as-4-ad3722eeda59cb2bcffa205f6ad8fbb37cf55504.zip
solved bug resource not found
Diffstat (limited to 'pdf-as-pdfbox-2')
-rw-r--r--pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox2/PADESPDFBOXSigner.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox2/PADESPDFBOXSigner.java b/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox2/PADESPDFBOXSigner.java
index 4f229874..0398e75b 100644
--- a/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox2/PADESPDFBOXSigner.java
+++ b/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox2/PADESPDFBOXSigner.java
@@ -69,6 +69,7 @@ import org.apache.pdfbox.pdmodel.documentinterchange.logicalstructure.PDStructur
import org.apache.pdfbox.pdmodel.documentinterchange.logicalstructure.PDStructureTreeRoot;
import org.apache.pdfbox.pdmodel.encryption.AccessPermission;
import org.apache.pdfbox.pdmodel.graphics.color.PDOutputIntent;
+import org.apache.pdfbox.pdmodel.graphics.image.JPEGFactory;
import org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject;
import org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature;
import org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptions;
@@ -331,9 +332,10 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants {
// Placeholder found!
// replace placeholder
- URL fileUrl = PADESPDFBOXSigner.class.getResource("/placeholder/empty.jpg");
- PDImageXObject img = PDImageXObject.createFromFile(fileUrl.getPath(), doc);
+ InputStream fis = PADESPDFBOXSigner.class.getResourceAsStream("/placeholder/empty.jpg");
+ PDImageXObject img = JPEGFactory.createFromStream(doc, fis);
+
img.getCOSObject().setNeedToBeUpdated(true);
// PDDocumentCatalog root = doc.getDocumentCatalog();