Coordinates relations

Hello,

I have the following problem:

I need the PDF page coordinates in relation to the client rectangle. I need the offset of the left edge of the PDF page within the client rectangle.

I tried  something with the following 3 methods, unfortunately without success

Dim posX As Single = unitConvertor.ConvertFromPixels(CSng((pPos.X / dblkorr)), PdfGraphicsUnit.Point)           
Dim posY As Single = unitConvertor.ConvertFromPixels(CSng((pPos.Y / dblkorr)), PdfGraphicsUnit.Point)
I get values, but I can't really do anything it, because I don't have a reference value

The following two functions do not return any values. The result is always 0.0. It doesn't matter what values you enter in pPOs. It seems like the functions don't do anything. There is no exception shown.

Dim pagePoint As Point = pdfViewer.pdfViewerControl.convertClientPointToPagePoint(pPos,0)
Dim clPoint As Point = pdfViewer.pdfViewerControl.convertPagePointToClientPoint(pPOs, 0)

For full information, I'm hosting the wpf pdfviewer in a WinForms form.
Except for my difficulties with the coordinates, everything is going well.

Do you have any idea to help me?

Thanks and regards
helmut


3 Replies

HE Helmut September 4, 2022 12:32 PM UTC

It was my mistake. I think that solved the problem

Dim pagePoint As Point = pdfViewer.pdfViewerControl.convertClientPointToPagePoint(pPos,0)
Dim clPoint As Point = pdfViewer.pdfViewerControl.convertPagePointToClientPoint(pPOs, 0)
If the pagenummber is not 0, then these functions are working.

Regards

Helmut



SS SalmanBaris ShahulHameed Syncfusion Team September 5, 2022 01:05 PM UTC

Hi Helmut,


Thanks for contacting Syncfusion Support,


The two APIs  ConvertClientPointToPagePoint  and ConvertPagePointToClientPoint in the Syncfusion PdfViewer Control only accept page numbers, so you can pass the page number instead of the page index.

If you have passed the page number is 0 or greater than page count , it will return 0,0 points.


Please let us know if you need any further assistance.


Regards,

Salman



HE Helmut September 9, 2022 08:18 AM UTC

Hallo Salman,

Thank You very much.
The problem is solved.
regards
Helmut


Loader.
Up arrow icon