Hello,
I use RadPdfViewer to view a PDF file in my WPF application, the PDF file has only one page and the contents are in the middle of the page, so I'm trying to zoom and focus on the middle of the page, I use the following code:
private void DocumentChanged(object sender, DocumentChangedEventArgs e)
{
pdfViewer.ScaleFactor = 1.3;
var size = pdfViewer.Document.Pages[0].Size;
pdfViewer.ScrollToVerticalOffset(size.Height * 0.3);
pdfViewer.ScrollToHorizontalOffset(size.Width * 0.20);
}
however, I only see the horizontal scroll working.
How can I zoom then scroll to vertical and horizontal offset?
Hello Turk,
I tried to replicate the behavior you are describing by incorporating the provided code snippets in a project on my end, but it happens to work as expected. I might be missing something important so I am attaching the project for you to take a look at as well. Feel free to examine it and compare differences and please let me know if there is something I should add or change. If you could also modify the project so that it reproduces the same results you are experiencing, please send it back to me for examination.
Looking forward to your reply.
Regards,
Yoan