From e0d280a78d86f32866d80a2a7e97db4d5a6292fd Mon Sep 17 00:00:00 2001 From: tknall Date: Mon, 28 Jan 2013 17:29:47 +0000 Subject: Minor issues (e.g. source code encoding issues) fixed. Cleanup tasks... git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/pdf-as/trunk@929 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../knowcenter/wag/egov/egiz/pdf/PDFUtilities.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/pdf/PDFUtilities.java') 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 e2a3d06..bdc1078 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 @@ -50,7 +50,7 @@ import com.lowagie.text.DocumentException; */ public abstract class PDFUtilities { - public static float calculatePageLength(final PdfDataSource pdfDataSource,int page ,float footer_line, int pagerotation) throws PDFDocumentException + public static float calculatePageLength(final PdfDataSource pdfDataSource, int page, float effectivePageHeight, int pagerotation) throws PDFDocumentException { try { @@ -67,7 +67,7 @@ public abstract class PDFUtilities parser.parse(); PDDocument pdfDocument_ = parser.getPDDocument(); - float page_length = calculatePageLength(pdfDocument_,page , footer_line, pagerotation); + float page_length = calculatePageLength(pdfDocument_, page, effectivePageHeight, pagerotation); pdfDocument_.close(); return page_length; } @@ -80,23 +80,23 @@ public abstract class PDFUtilities throw new PDFDocumentException(201, e); } } - public static float calculatePageLength(PDDocument document,int page ,float footer_line, int pagerotation) throws IOException + public static float calculatePageLength(PDDocument document, int page, float effectivePageHeight, int pagerotation) 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, footer_line); + return calculatePageLength(pdpage, effectivePageHeight); } /** * @deprecated * @param pdf - * @param footer_line + * @param effectivePageHeight * @return * @throws PDFDocumentException */ - public static float calculateLastPageLength(final byte[] pdf, float footer_line) throws PDFDocumentException + public static float calculateLastPageLength(final byte[] pdf, float effectivePageHeight) throws PDFDocumentException { try { @@ -112,7 +112,7 @@ public abstract class PDFUtilities parser.parse(); PDDocument pdfDocument_ = parser.getPDDocument(); - float last_page_length = calculateLastPageLength(pdfDocument_, footer_line); + float last_page_length = calculateLastPageLength(pdfDocument_, effectivePageHeight); pdfDocument_.close(); return last_page_length; @@ -127,20 +127,20 @@ public abstract class PDFUtilities } } - public static float calculateLastPageLength(PDDocument document, float footer_line) throws IOException + public static float calculateLastPageLength(PDDocument document, float effectivePageHeight) 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, footer_line); + return calculatePageLength(last_page, effectivePageHeight); } - public static float calculatePageLength(PDPage page, float footer_line) throws IOException + public static float calculatePageLength(PDPage page, float effectivePageHeight) throws IOException { // logger_.debug("Last Page id:" + last_page_id); // PDPage last_page = (PDPage) allPages.get(0); - PDFPage my_page = new PDFPage(footer_line); + PDFPage my_page = new PDFPage(effectivePageHeight); my_page.processStream(page, page.findResources(), page.getContents().getStream()); return my_page.getMaxPageLength(); } -- cgit v1.2.3