Click here to Skip to main content
15,891,409 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I'm generating a Export PDF using DebenuPDF library, my question is not related to Debenu.

In my web page I will render tiff file with static height and width. In the Tiff file user can add the annotation. Height and width example as shown below

Page Height = 600
Page Width = 400

While the user plotting the annotation I was capturing the X and Y co-ordinates

X co-ordinate = 121.25
Y co-ordinate = 325.90

While exporting the pdf I have to do it in original size of tiff file what the user uploaded such as

Page Height = 1210
Page Width = 1650

I want to know plot the annotation where the user plotted. While exporting the PDF annotations are plotted with old X and Y co-ordinates so its pointing to some other places

Please anybody suggest the formula to calculate the X and Y co-ordinates with new height and width.
Posted

1 solution

Not sure I read that well, but:

If your format is scaled from 600x400 to 1210x1650, then you have a X scaling of 1210/600=2,0167 and a Y scaling of 1650/400=4,125. In your example, and assuming linear, the new x and y coordinate would be X=1210/600*121,25=244 and Y=1650/400*325,9=1340
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900