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.java22
1 files changed, 11 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 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();
}