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

Notification

Icon
Error

Options
Go to last post Go to first unread
gffranca  
#1 Posted : Friday, December 13, 2019 12:52:18 PM(UTC)
gffranca

Rank: Newbie

Groups: Registered
Joined: 11/1/2019(UTC)
Posts: 2
Brazil
Location: Rio de Janeiro

I want to find underlined words in a pdf. PdfTextObject class doesn't show such information. How can I get those?
Paul Rayman  
#2 Posted : Monday, December 16, 2019 12:37:27 AM(UTC)
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 855

Thanks: 2 times
Was thanked: 103 time(s) in 101 post(s)
According to the PDF specification, text objects do not have such an attribute as "underlined word".
The underline effect is achieved by using specialized annotations.
Try the following code:

Code:

foreach (var annot in page.Annots)
{
    if (!(annot is PdfUnderlineAnnotation))
        continue;

    string text = page.Text.GetBoundedText(annot.Rectangle);
}
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.