Patagames Software Support Forum
»
Pdfium.Net SDK
»
Common Questions
»
How to find rotated PdfTextObject's rotated bounding box?
Rank: Advanced Member
Groups: Registered
Joined: 4/30/2019(UTC) Posts: 46 Location: Raisio Thanks: 11 times Was thanked: 3 time(s) in 2 post(s)
|
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
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,107
Thanks: 7 times Was thanked: 130 time(s) in 127 post(s)
|
What do you mean under bounding box, the quadrilateral like this: 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: - Create clone of TextObject;
- Rotate it to the angle that is opposite to the angle of the source text object;
- Get bounding box of this text object;
- Rotate the bounding box to the original angle;
Edited by user Friday, June 14, 2019 5:06:51 AM(UTC)
| Reason: Not specified
|
1 user thanked Paul Rayman for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 4/30/2019(UTC) Posts: 46 Location: Raisio Thanks: 11 times Was thanked: 3 time(s) in 2 post(s)
|
You are a genius! And we are, obviously, dumb! :D Thank you!!!
|
|
|
|
Patagames Software Support Forum
»
Pdfium.Net SDK
»
Common Questions
»
How to find rotated PdfTextObject's rotated bounding box?
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.
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close