aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorafitzek <afitzek@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2012-11-27 07:31:53 +0000
committerafitzek <afitzek@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2012-11-27 07:31:53 +0000
commitd1bb2fc2f16d9d783bfec6e87eba8af407712db3 (patch)
tree91b97ea505a32273e1e56f2792323761fbd2f2a7 /src
parent168477fe312474c95e326383f8c101247a6f206f (diff)
downloadpdf-as-3-d1bb2fc2f16d9d783bfec6e87eba8af407712db3.tar.gz
pdf-as-3-d1bb2fc2f16d9d783bfec6e87eba8af407712db3.tar.bz2
pdf-as-3-d1bb2fc2f16d9d783bfec6e87eba8af407712db3.zip
Fixed error in signature placement for landscape format
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@921 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/pdf/PDFPage.java35
1 files changed, 29 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 6ac0900..a0311da 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
@@ -117,9 +117,31 @@ public class PDFPage extends PDFTextStripper
*/
protected void showCharacter(TextPosition text)
{
- final float current_y = text.getY();
+ float current_y = text.getY();
final String character = text.getCharacter();
+ int pageRotation = page.findRotation();
+ //logger_.debug("PageRotation = " + pageRotation);
+ if (pageRotation == 0)
+ {
+ current_y = text.getY();
+ }
+ if (pageRotation == 90)
+ {
+ current_y = text.getX();
+ }
+ if (pageRotation == 180)
+ {
+ float page_height = page.findMediaBox().getHeight();
+ current_y = page_height - text.getY();
+ }
+ if (pageRotation == 270)
+ {
+ float page_height = page.findMediaBox().getHeight();
+ current_y = page_height - text.getX();
+ }
+
+
if (current_y > this.footer_line)
{
//logger_.debug("character is below footer_line. footer_line = " + this.footer_line + ", text.character=" + character + ", y=" + current_y);
@@ -134,7 +156,7 @@ public class PDFPage extends PDFTextStripper
// System.err.println(character + "|" + current_y);
}
- //logger_.debug("text.character=" + character + ", y=" + current_y);
+ //logger_.error("text.character=" + character + ", y=" + current_y + " max_c=" + this.max_character_ypos);
// System.err.println(character + "|" + current_y);
}
@@ -160,7 +182,7 @@ public class PDFPage extends PDFTextStripper
{
max_ypos = this.max_image_ypos;
}
-
+ //logger_.error("max len=" + max_ypos);
return max_ypos;
}
@@ -170,7 +192,7 @@ public class PDFPage extends PDFTextStripper
public void process(PDFOperator operator, List arguments) throws IOException
{
COSName name = (COSName) arguments.get(0);
- //logger_.debug("<Do name=\"" + name.getName() + "\">");
+ //logger_.error("<Do name=\"" + name.getName() + "\">");
// PDResources res = context.getResources();
@@ -181,12 +203,13 @@ public class PDFPage extends PDFTextStripper
COSStream cos_stream = stream.getStream();
COSName subtype = (COSName) cos_stream.getDictionaryObject(COSName.SUBTYPE);
+ //logger_.error("<Do subtype name=\"" + subtype.getName() + "\">");
if (subtype.equals(COSName.IMAGE))
{
- logger_.debug("XObject Image");
+ //logger_.error("XObject Image");
Matrix ctm = context.getGraphicsState().getCurrentTransformationMatrix();
- logger_.debug("ctm = " + ctm);
+ //logger_.debug("ctm = " + ctm);
Pos [] coordinates = new Pos [] {
new Pos(0, 0, 1),