logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Post a reply
From:
Message:

Maximum number of characters in each post is: 32767
Bold Italic Underline   Highlight Quote Choose Language for Syntax Highlighting Insert Image Insert an existing Attachment or upload a new File... Create Link   Unordered List Ordered List   Left Justify Center Justify Right Justify   Outdent Indent   More BBCode Tags
Font Color Font Size
Security Image:
Enter The Letters From The Security Image:
  Preview Post Cancel

Last 10 Posts (In reverse order)
Paul Rayman Posted: Wednesday, March 23, 2016 7:53:34 PM(UTC)
 
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.
Thomas Vogel Posted: Wednesday, March 23, 2016 1:13:12 AM(UTC)
 
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