aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/pdf/PDFUtilities.java
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/pdf/PDFUtilities.java')
-rw-r--r--pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/pdf/PDFUtilities.java25
1 files changed, 14 insertions, 11 deletions
diff --git a/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/pdf/PDFUtilities.java b/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/pdf/PDFUtilities.java
index 3f5e67fc..808efbe4 100644
--- a/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/pdf/PDFUtilities.java
+++ b/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/pdf/PDFUtilities.java
@@ -82,19 +82,22 @@ public abstract class PDFUtilities {
try {
PDFPage my_page = new PDFPage(effectivePageHeight, legacy32);
PDResources resources = page.findResources();
- COSStream stream = page.getContents().getStream();
- // List<PDThreadBead> articles = page.getThreadBeads();
- // my_page.processMyPage(page);
- my_page.processStream(page, resources, stream);
-
+ if (page.getContents() != null) {
+ COSStream stream = page.getContents().getStream();
+ // List<PDThreadBead> articles = page.getThreadBeads();
+ // my_page.processMyPage(page);
+ my_page.processStream(page, resources, stream);
+ }
if (!legacy32) {
- Iterator<PDAnnotation> annotationsIt = page.getAnnotations()
- .iterator();
+ if (page.getAnnotations() != null) {
+ Iterator<PDAnnotation> annotationsIt = page
+ .getAnnotations().iterator();
- while (annotationsIt.hasNext()) {
- PDAnnotation annotation = annotationsIt.next();
- if(!annotation.isInvisible()) {
- my_page.processAnnotation(annotation);
+ while (annotationsIt.hasNext()) {
+ PDAnnotation annotation = annotationsIt.next();
+ if (!annotation.isInvisible()) {
+ my_page.processAnnotation(annotation);
+ }
}
}
}