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

Notification

Icon
Error

Options
Go to last post Go to first unread
ESchunk  
#1 Posted : Thursday, March 26, 2020 3:11:18 PM(UTC)
ESchunk

Rank: Member

Groups: Registered
Joined: 8/13/2019(UTC)
Posts: 19
United States
Location: New York

Thanks: 2 times
I have a PDF file with characters that are rotated 90 degrees and not rotated on the same page. Is there a way to determine if a character is rotated? Attached is a sample file with rotated and regular text on the same page.

Thanks,

Ted

Sample File.pdf (36kb) downloaded 3 time(s).
Paul Rayman  
#2 Posted : Sunday, March 29, 2020 6:15:58 PM(UTC)
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)
You can try checking the Matrix property of the text page object.

Code:

using (var doc = PdfDocument.Load(@"e:\49\SampleFile.pdf"))
{
    foreach(var page in doc.Pages)
    { 
        foreach(var pageObject in page.PageObjects)
        {
            var textObject = pageObject as PdfTextObject;
            if (textObject == null)
                continue;

            check the textObject.Matrix here
        }
    }
}


Read more about the transformation matrix here:
https://forum.patagames.com/posts/m1365findunread-What-Is-Transformation-Matrix-and-How-to-Use-It
thanks 1 user thanked Paul Rayman for this useful post.
ESchunk on 3/30/2020(UTC)
Users browsing this topic
Guest (2)
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.