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
rhnatiuk  
#1 Posted : Friday, June 7, 2019 6:03:47 AM(UTC)
Quote
rhnatiuk

Rank: Advanced Member

Groups: Registered
Joined: 4/30/2019(UTC)
Posts: 35
Man
Finland
Location: Raisio

Thanks: 9 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)
Quote
Paul Rayman

Rank: Administration

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

Thanks: 3 times
Was thanked: 103 time(s) in 101 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)
Quote
rhnatiuk

Rank: Advanced Member

Groups: Registered
Joined: 4/30/2019(UTC)
Posts: 35
Man
Finland
Location: Raisio

Thanks: 9 times
You are a genius! And we are, obviously, dumb! :D Thank you!!!
Quick Reply Show Quick Reply
Users browsing this topic
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.