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

Notification

Icon
Error

New Topic Post Reply
Options
Go to last post Go to first unread
Thomas Vogel  
#1 Posted : Wednesday, March 23, 2016 1:13:12 AM(UTC)
Quote
Thomas Vogel

Rank: Newbie

Groups: Registered
Joined: 3/23/2016(UTC)
Posts: 1
Germany

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
Paul Rayman  
#2 Posted : Wednesday, March 23, 2016 7:53:34 PM(UTC)
Quote
Paul Rayman

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

Quick Reply Show Quick Reply
Users browsing this topic
Guest
New Topic Post Reply
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.