Op 7/12/2012 0:48, Andreas Meyer schreef:
> same code, different result ...

It was a bug. Found it and fixed it. The fix will be in iText 5.3.5.

Log: Bug reported by Andreas Meyer on the mailing list (Dec 6, 2012). When 
retrieving rectangle information, the coordinates were accidentally switched.
Files: 
trunk/itext/src/main/java/com/itextpdf/text/pdf/internal/PdfAnnotationsImp.java

DIFF:https://sourceforge.net/p/itext/code/5596/

Modified: 
trunk/itext/src/main/java/com/itextpdf/text/pdf/internal/PdfAnnotationsImp.java
===================================================================
--- 
trunk/itext/src/main/java/com/itextpdf/text/pdf/internal/PdfAnnotationsImp.java 
    2012-12-07 10:05:13 UTC (rev 5595)
+++ 
trunk/itext/src/main/java/com/itextpdf/text/pdf/internal/PdfAnnotationsImp.java 
    2012-12-07 10:20:44 UTC (rev 5596)
@@ -168,11 +168,13 @@
                  array.add(dic.getIndirectReference());
                  if (!dic.isUsed()) {
                        PdfArray tmp = dic.getAsArray(PdfName.RECT);
-                    PdfRectangle rect = new 
PdfRectangle(tmp.getAsNumber(0).floatValue(), tmp.getAsNumber(1).floatValue());
+                    PdfRectangle rect;
                      if (tmp.size() == 4) {
-                       rect.add(tmp.getAsNumber(2));
-                       rect.add(tmp.getAsNumber(3));
+                       rect = new 
PdfRectangle(tmp.getAsNumber(0).floatValue(), tmp.getAsNumber(1).floatValue(), 
tmp.getAsNumber(2).floatValue(), tmp.getAsNumber(3).floatValue());
                      }
+                    else {
+                       rect = new 
PdfRectangle(tmp.getAsNumber(0).floatValue(), tmp.getAsNumber(1).floatValue());
+                    }
                      if (rect != null) {
                        switch (rotation) {
                                case 90:



------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to