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
edwin.rafe  
#1 Posted : Tuesday, November 28, 2017 1:36:50 AM(UTC)
Quote
edwin.rafe

Rank: Newbie

Groups: Registered
Joined: 9/21/2017(UTC)
Posts: 3

Thanks: 1 times
Greetings everyone,

Is there a way to get the HighlightedTextInfo from an specific page?

The only method that I found is to get HighlightedTextInfo from the PdfViewer object, and that will get me the HighlightedTextInfo from the whole document.

Looping in the returned HighlightInfo objects I can get the CharIndex but it is page relative and there is no property telling me the PageIndex in the HighlightInfo.

Thank you,
Ed

Paul Rayman  
#2 Posted : Tuesday, November 28, 2017 2:01:00 AM(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)
Hi,
HighlightedTextInfo is SortedDictionary where the key is a zero-based page index.

So the code that getting highlighted text may be like following
Code:

if (HighlightedTextInfo.ContainsKey(pageIndex))
{
  var textInfo = Document.Pages[pageIndex].Text.GetTextInfo(HighlightedTextInfo[pageIndex].CharIndex, HighlightedTextInfo[pageIndex].CharsCount);
  string text = textInfo.Text;
}

Edited by user Tuesday, November 28, 2017 2:02:29 AM(UTC)  | Reason: Not specified

thanks 1 user thanked Paul Rayman for this useful post.
edwin.rafe on 11/30/2017(UTC)
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.