aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-pdfbox-2/src
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-as-pdfbox-2/src')
-rw-r--r--pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/positioning/Positioning.java11
-rw-r--r--pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox2/PADESPDFBOXSigner.java7
-rw-r--r--pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox2/PDFBoxTable.java1
-rw-r--r--pdf-as-pdfbox-2/src/main/java/at/knowcenter/wag/egov/egiz/pdfbox2/pdf/PDFUtilities.java21
4 files changed, 20 insertions, 20 deletions
diff --git a/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/positioning/Positioning.java b/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/positioning/Positioning.java
index 1a51b4db..534c6c40 100644
--- a/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/positioning/Positioning.java
+++ b/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/positioning/Positioning.java
@@ -171,22 +171,17 @@ public class Positioning {
page = pos.getPage();
// System.out.println("XXXXPAGE="+page+" doc_pages="+doc_pages);
- if (page > doc_pages && page!=1) {
+ if (page > doc_pages) {
make_new_page = true;
page = doc_pages;
- // throw new PDFDocumentException(227, "Page number is to big(="
- // + page+
- // ") cannot be parsed.");
- }
- if (page < doc_pages && page!=1) {
- page = page - 1;
}
}
+
+
PDPage pdPage = pdfDataSource.getPage(page-1);
- //PDPage pdPage = pdfDataSource.getPages().get(page);
PDRectangle cropBox = pdPage.getCropBox();
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 5db09ea1..3cb103a7 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
@@ -132,7 +132,6 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants {
COSDocument visualSignatureDocumentGuard = null;
try {
-
doc = pdfObject.getDocument();
SignaturePlaceholderData signaturePlaceholderData = PlaceholderFilter
@@ -359,7 +358,9 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants {
COSBase base = root.getCOSObject().getItem(COSName.OUTPUT_INTENTS);
InputStream colorProfile = null;
- colorProfile = this.getClass().getResourceAsStream("/icm/sRGB.icm");
+ //colorProfile = this.getClass().getResourceAsStream("/icm/sRGB.icm");
+ colorProfile = this.getClass().getResourceAsStream("/icm/sRGB Color Space Profile.icm");
+
//Set output intents for PDF/A conformity//
try {
PDOutputIntent intent = new PDOutputIntent(doc, colorProfile);
@@ -382,7 +383,7 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants {
IOUtils.closeQuietly(colorProfile);
}
}
- options.setPage(positioningInstruction.getPage());
+ options.setPage(positioningInstruction.getPage()-1);
options.setVisualSignature(properties.getVisibleSignature());
}
diff --git a/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox2/PDFBoxTable.java b/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox2/PDFBoxTable.java
index bb692f06..bc634dc5 100644
--- a/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox2/PDFBoxTable.java
+++ b/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox2/PDFBoxTable.java
@@ -85,7 +85,6 @@ public class PDFBoxTable {
case Entry.TYPE_CAPTION:
case Entry.TYPE_VALUE:
String value = (String) cell.getValue();
-
//Check if the used value font supports all characters in string
PDFont f = null;
try{
diff --git a/pdf-as-pdfbox-2/src/main/java/at/knowcenter/wag/egov/egiz/pdfbox2/pdf/PDFUtilities.java b/pdf-as-pdfbox-2/src/main/java/at/knowcenter/wag/egov/egiz/pdfbox2/pdf/PDFUtilities.java
index 08ef64b7..995b4e10 100644
--- a/pdf-as-pdfbox-2/src/main/java/at/knowcenter/wag/egov/egiz/pdfbox2/pdf/PDFUtilities.java
+++ b/pdf-as-pdfbox-2/src/main/java/at/knowcenter/wag/egov/egiz/pdfbox2/pdf/PDFUtilities.java
@@ -89,17 +89,22 @@ public abstract class PDFUtilities implements IConfigurationConstants{
int yCoord = bim.getHeight() - 1 - (int)footer_line;
- for(int row = yCoord; row >= 0; row--){
- for(int col = 0; col < bim.getWidth(); col++){
- int val = bim.getRGB(col, row);
- if(val != bgColor.getRGB()){
- yCoord = row;
- row=-1;
- break;
+ for(int row = yCoord; row >= 0; row--)
+ {
+ if (row == 0)
+ yCoord = row;
+ else
+ {
+ for(int col = 0; col < bim.getWidth(); col++){
+ int val = bim.getRGB(col, row);
+ if(val != bgColor.getRGB()){
+ yCoord = row;
+ row=-1;
+ break;
+ }
}
}
}
-
String outFile = settings.getValue(SIG_PLACEMENT_DEBUG_OUTPUT);
if(outFile!=null){
ImageIOUtil.writeImage(bim, outFile, 72);