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

Notification

Icon
Error

Options
Go to last post Go to first unread
rhnatiuk  
#1 Posted : Friday, June 7, 2019 6:03:47 AM(UTC)
rhnatiuk

Rank: Member

Groups: Registered
Joined: 4/30/2019(UTC)
Posts: 11
Finland

Thanks: 5 times
Hi,

Yet another noob question :)

Is it possible to find out the rotated bounding box of a rotated PdfTextObject? By "rotated" bounding box I mean a bounding box aligned with the rotated text, i.e. that is rotated by the same angle.

Our old PDF library was able to produce such a bounding box, but I cannot figure out if it is possible with Pdfium.Net.

Best regards,
Roman
Paul Rayman  
#2 Posted : Friday, June 14, 2019 5:06:09 AM(UTC)
Paul Rayman

Rank: Administration

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

Thanks: 1 times
Was thanked: 90 time(s) in 89 post(s)
What do you mean under bounding box, the quadrilateral like this:
quadrilateral
or rectangle with coordinates (left/top) - (right/bottom) (x4, y3) - (x2,y1)

There is no easy way to get quadrilateral of rotated text object, but you can calculate it.
I can suggest the following workaround:
  1. Create clone of TextObject;
  2. Rotate it to the angle that is opposite to the angle of the source text object;
  3. Get bounding box of this text object;
  4. Rotate the bounding box to the original angle;

Edited by user Friday, June 14, 2019 5:06:51 AM(UTC)  | Reason: Not specified

thanks 1 user thanked Paul Rayman for this useful post.
rhnatiuk on 6/14/2019(UTC)
rhnatiuk  
#3 Posted : Friday, June 14, 2019 5:43:40 AM(UTC)
rhnatiuk

Rank: Member

Groups: Registered
Joined: 4/30/2019(UTC)
Posts: 11
Finland

Thanks: 5 times
You are a genius! And we are, obviously, dumb! :D Thank you!!!
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.