Rank: Newbie
Groups: Registered
Joined: 3/23/2016(UTC) Posts: 1 
|
Hi,
I used both controls, the WPF and the WinForms control (WinForms preferred). My problem is the following: First, the user zooms into a page inside a PDF document. Then, he'd like to search for a specific text.
While both functions (Zoom and Highlighting) works perfectly when the whole page is shown, there is a problem to get Highlighted text into the visible area of a zoomed page. Is there an explanation how to accomplish that?
Currently, I have two dlls referenced in my project. PataGames.Pdf.Winforms and PataGames.Pdf.
Many thanks for your help
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
I don't quite understand there you have a problems. Are you use PdfToolStripSearch or implements the search routine yourself via PdfSearch Class? If I understand you correctly, in order to determine whether the text on the page is visible, you can get the bounding boxes of each found characters in the page's coordinates. Code:
var textInfo = Document.Pages[pageIndex].Text.GetTextInfo(e.CharIndex, e.CharsCount);
Next you can convert them to the control's coordinate system. Code:
var pt1 = pdfViewer1.PageToDevice(rc.left, rc.top, pageIndex);
var pt2 = pdfViewer1.PageToDevice(rc.right, rc.bottom, pageIndex);
And then compare these coordinates with PdfViewer's ClientArea. Edited by user Wednesday, March 23, 2016 8:15:07 PM(UTC)
| Reason: Not specified
|
|
|
|
|
|
Forum Jump
You can post new topics in this forum.
You can reply to topics in this forum.
You can delete your posts in this forum.
You can edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.
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