pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kirk, Kenneth" <Kk...@ILSOS.GOV>
Subject Scaling Rectangle
Date Wed, 20 Mar 2019 19:19:50 GMT
We have document management application that creates graphic annotations for documents of various
types such as word, text, spreadsheets, PDF and such.  I need to take the PDFs and merge the
graphic annotations by creating PDF annotations and placing them in the PDF.  The problem
I am having is that the graphic annotation were positioned using 96 dpi and the PDF specification
is 72 dpi.    I tried scaling the rectangle from document management application down by 25
percent as this is roughly the difference going from 96 to 72 but the annotations don't line
up.  Below is the code I use to scale  the rectangle.

                                  java.awt.Rectangle borderRect = annotation.getRefreshRect();
                                  float x = (float) (borderRect.x / 1.25);
                                  float y = (float) (borderRect.y / 1.25);
                                  float h = (float) (borderRect.height/ 1.25);
                                  float w = (float) (borderRect.width/ 1.25);
                                  PDRectangle borderLocation = new PDRectangle(x,
                                                                            (pageHeight -
y)-h,
                                                                                         
 w,
                                                                                         
  y);
The placement is in the ballpark but still way off.  How should I approach this problem.

Kenneth D. Kirk
Information Systems Advisor
Document Management
Information Technology









************************************************
Disclaimer - This email and any files transmitted with it are confidential and contain privileged
or copyright information. You must not present this message to another party without gaining
permission from the sender. If you are not the intended recipient you must not copy, distribute
or use this email or the information contained in it for any purpose other than to notify
the Office of the Illinois Secretary of State. 

If you have received this message in error, please notify the sender immediately, and delete
this email from your system. Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be the views of the Office of
the Illinois Secretary of State. 
************************************************











Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message