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.java20
1 files changed, 10 insertions, 10 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 b3adb71..6009995 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
@@ -51,7 +51,7 @@ import com.lowagie.text.DocumentException;
*/
public abstract class PDFUtilities
{
- public static float calculatePageLength(final PdfDataSource pdfDataSource, int page, float effectivePageHeight, int pagerotation) throws PDFDocumentException
+ public static float calculatePageLength(final PdfDataSource pdfDataSource, int page, float effectivePageHeight, int pagerotation, boolean legacy32) throws PDFDocumentException
{
PDDocument pdfDocument_ = null;
try
@@ -69,7 +69,7 @@ public abstract class PDFUtilities
parser.parse();
pdfDocument_ = parser.getPDDocument();
- float page_length = calculatePageLength(pdfDocument_, page, effectivePageHeight, pagerotation);
+ float page_length = calculatePageLength(pdfDocument_, page, effectivePageHeight, pagerotation, legacy32);
return page_length;
}
catch (IOException e)
@@ -83,13 +83,13 @@ public abstract class PDFUtilities
PDFASUtils.closeQuietly(pdfDocument_);
}
}
- public static float calculatePageLength(PDDocument document, int page, float effectivePageHeight, int pagerotation) throws IOException
+ public static float calculatePageLength(PDDocument document, int page, float effectivePageHeight, int pagerotation, boolean legacy32) throws IOException
{
//int last_page_id = document.getNumberOfPages();
List allPages = document.getDocumentCatalog().getAllPages();
PDPage pdpage = (PDPage) allPages.get(page);
pdpage.setRotation(pagerotation);
- return calculatePageLength(pdpage, effectivePageHeight);
+ return calculatePageLength(pdpage, effectivePageHeight, legacy32);
}
/**
@@ -99,7 +99,7 @@ public abstract class PDFUtilities
* @return
* @throws PDFDocumentException
*/
- public static float calculateLastPageLength(final byte[] pdf, float effectivePageHeight) throws PDFDocumentException
+ public static float calculateLastPageLength(final byte[] pdf, float effectivePageHeight, boolean legacy32) throws PDFDocumentException
{
PDDocument pdfDocument_ = null;
try
@@ -116,7 +116,7 @@ public abstract class PDFUtilities
parser.parse();
pdfDocument_ = parser.getPDDocument();
- float last_page_length = calculateLastPageLength(pdfDocument_, effectivePageHeight);
+ float last_page_length = calculateLastPageLength(pdfDocument_, effectivePageHeight, legacy32);
return last_page_length;
}
@@ -132,20 +132,20 @@ public abstract class PDFUtilities
}
}
- public static float calculateLastPageLength(PDDocument document, float effectivePageHeight) throws IOException
+ public static float calculateLastPageLength(PDDocument document, float effectivePageHeight, boolean legacy32) throws IOException
{
int last_page_id = document.getNumberOfPages();
List allPages = document.getDocumentCatalog().getAllPages();
PDPage last_page = (PDPage) allPages.get(last_page_id - 1);
- return calculatePageLength(last_page, effectivePageHeight);
+ return calculatePageLength(last_page, effectivePageHeight, legacy32);
}
- public static float calculatePageLength(PDPage page, float effectivePageHeight) throws IOException
+ public static float calculatePageLength(PDPage page, float effectivePageHeight, boolean legacy32) throws IOException
{
// logger_.debug("Last Page id:" + last_page_id);
// PDPage last_page = (PDPage) allPages.get(0);
- PDFPage my_page = new PDFPage(effectivePageHeight);
+ PDFPage my_page = new PDFPage(effectivePageHeight, legacy32);
my_page.processStream(page, page.findResources(), page.getContents().getStream());
return my_page.getMaxPageLength();
}