aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/knowcenter/wag/egov/egiz/pdf/PDFPage.java
diff options
context:
space:
mode:
authortknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2007-02-07 10:08:21 +0000
committertknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2007-02-07 10:08:21 +0000
commita0de2a3b2a5f4a99f280f5caebbca0d183ae109a (patch)
tree7479e30c10c3994cba18c6bf8784f61748bb6cd3 /src/main/java/at/knowcenter/wag/egov/egiz/pdf/PDFPage.java
parent8f7cebd9c2c5c0f6e33863ba57ad1c215f35605c (diff)
downloadpdf-as-3-a0de2a3b2a5f4a99f280f5caebbca0d183ae109a.tar.gz
pdf-as-3-a0de2a3b2a5f4a99f280f5caebbca0d183ae109a.tar.bz2
pdf-as-3-a0de2a3b2a5f4a99f280f5caebbca0d183ae109a.zip
Bugfix: Querformat, BKU 2.7.x, ...
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@35 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/at/knowcenter/wag/egov/egiz/pdf/PDFPage.java')
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/pdf/PDFPage.java34
1 files changed, 28 insertions, 6 deletions
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/PDFPage.java b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/PDFPage.java
index c98aee8..c1d6681 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/PDFPage.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/PDFPage.java
@@ -66,14 +66,23 @@ public class PDFPage extends PDFTextStripper
protected float max_image_ypos = Float.NEGATIVE_INFINITY;
/**
- * The empty constructor.
+ * The y coordinate of the footer line. PDF elements below this footer line will not be regarded.
+ */
+ protected float footer_line = 0.0f;
+
+ /**
+ * Constructor.
+ *
+ * @param footer_line The y coordinate of the footer line. PDF elements below this footer line will not be regarded.
*
* @throws IOException
*/
- public PDFPage() throws IOException
+ public PDFPage(float footer_line) throws IOException
{
super();
+ this.footer_line = footer_line;
+
OperatorProcessor newInvoke = new MyInvoke();
newInvoke.setContext(this);
operators.put("Do", newInvoke);
@@ -341,17 +350,24 @@ public class PDFPage extends PDFTextStripper
*/
protected void showCharacter(TextPosition text)
{
- float current_y = text.getY();
- String character = text.getCharacter();
+ final float current_y = text.getY();
+ final String character = text.getCharacter();
+
+// if (current_y > this.footer_line)
+// {
+// logger_.debug("character is below footer_line. footer_line = " + this.footer_line + ", text.character=" + character + ", y=" + current_y);
+// return;
+// }
+
// store ypos of the char if it is not empty
if (!character.equals(" ") && current_y > this.max_character_ypos)
{
this.max_character_ypos = current_y;
- //logger_.debug("text.character=" + character + ", y=" + current_y);
+ logger_.debug("text.character=" + character + ", y=" + current_y);
// System.err.println(character + "|" + current_y);
}
- // logger_.debug("text.character=" + character + ", y=" + current_y);
+ logger_.debug("text.character=" + character + ", y=" + current_y);
// System.err.println(character + "|" + current_y);
}
@@ -454,6 +470,12 @@ public class PDFPage extends PDFTextStripper
logger_.debug("actual_lowest_point = " + actual_lowest_point);
+ if (actual_lowest_point > PDFPage.this.footer_line)
+ {
+ logger_.debug("image is below footer_line. footer_line = " + PDFPage.this.footer_line);
+ return;
+ }
+
if (actual_lowest_point > PDFPage.this.max_image_ypos)
{
PDFPage.this.max_image_ypos = actual_lowest_point;