|
|
Try to use PdfViewer.PageToClient() or, if PdfViewer is not used in your App, then PdfPage.PageToDevice().
|
|
|
I believe I figured this out. To calculate the difference for top and bottom in pdfium to winforms you need to use (page height * 1.33) - (control top * 1.33)
|
|
|
I am using pdfium to handle converting a pdf to a designer.cs file for winforms.
Conversion of pdfium points to winform pixels. The direct conversion seems to work only for left and right coordinates and not the top / bottom coordinates.
Example:
I have a control who's points are L:270.96, B:684.24, R: 383.16, T:699.6 in pdfium
Converting the Right and Left points using 1.3 (96/72)
L to px => 270.96 pt * 1.3 px/pt = 352.25px R to px => 383.16 pt * 1.3 px/pt = 498.11px
This conversion equal(given +/- 3 px) the correct L and R values.
When converting Top and Bottom from pt to px Top to px => 699.6 pt * 1.3 px/pt = 909.48 px Bottom to px => 684.24 * 1.3 px/pt = 889.51 px
The values I expect for Top is 122 and Bottom are 142. My assumption is pdfium uses a different quadrant system then what winforms uses. I believe winform uses the top left as the origin with values increasing as the move away from the origin.
*------- | | | |
Is there a way to convert the top and bottom coordinates from pdfium into winform coordinates?
|
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close