Determine if Text or Box is rotated for Annotation?
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan
Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Determine if Text or Box is rotated for Annotation?
Hi -
I have been given a PDF that includes several Comments of this kind : pxInst.StrToAtom("Square")
Some of the comments are rotated (or their content is, I'm not certain which)
For example, when opening the PDF, most comments are normal - that is, horizontal just like this text.
Some are vertical though - as though either the box or the contents were rotated 90 degrees.
I've tried comparing height/width but that doesn't always work....it may work for a single word or line of text
PIC 1:
but does not work if the text is in a tall rectangle.
PIC 2:
When I get the Annotation object, is there a way to determine if it is rotated?
I have been given a PDF that includes several Comments of this kind : pxInst.StrToAtom("Square")
Some of the comments are rotated (or their content is, I'm not certain which)
For example, when opening the PDF, most comments are normal - that is, horizontal just like this text.
Some are vertical though - as though either the box or the contents were rotated 90 degrees.
I've tried comparing height/width but that doesn't always work....it may work for a single word or line of text
PIC 1:
but does not work if the text is in a tall rectangle.
PIC 2:
When I get the Annotation object, is there a way to determine if it is rotated?
- Tracker Supp-Stefan
- Site Admin
- Posts: 17941
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Determine if Text or Box is rotated for Annotation?
Hello whoit,
I believe this is the one you need to determine if an annotation is rotated relative to the coordinate system of the page:
https://sdkhelp.pdf-xchange.com/vi ... a_Rotation
Regards,
Stefan
I believe this is the one you need to determine if an annotation is rotated relative to the coordinate system of the page:
https://sdkhelp.pdf-xchange.com/vi ... a_Rotation
Regards,
Stefan
Re: Determine if Text or Box is rotated for Annotation?
Hi Stefan -
I've tried that and all Annotations return "0".
I've previously sent a sample of this file for a different forum post - can you please check with Alex for "sample-Layout1_MONOComments.pdf"
The Annotation in question is in the original post "NORTH", which is the tenth annotation in the PDF.
Thanks.
I've tried that and all Annotations return "0".
I've previously sent a sample of this file for a different forum post - can you please check with Alex for "sample-Layout1_MONOComments.pdf"
The Annotation in question is in the original post "NORTH", which is the tenth annotation in the PDF.
Thanks.
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Determine if Text or Box is rotated for Annotation?
Hello Wayne,
The North (and all of the other words like this) does have a Square annotation around it, though the Square annotations themselves do not hold the text at all. The North word (and all of the others in this document) is a Path content type item - not a part of the annotation: Cheers,
Alex
The North (and all of the other words like this) does have a Square annotation around it, though the Square annotations themselves do not hold the text at all. The North word (and all of the others in this document) is a Path content type item - not a part of the annotation: Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Re: Determine if Text or Box is rotated for Annotation?
Hi Alex -
Ok I see that, but the text itself is still part of the annotation - you can see a popup when you mouse-over.
So, I am able to get the text from the Content property.
My issue is trying to determine when the annotation is Vertical vs Horizontal, and since the rotation always shows 0,
I'm trying to find another way...
-Wayne
Ok I see that, but the text itself is still part of the annotation - you can see a popup when you mouse-over.
So, I am able to get the text from the Content property.
My issue is trying to determine when the annotation is Vertical vs Horizontal, and since the rotation always shows 0,
I'm trying to find another way...
-Wayne
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Determine if Text or Box is rotated for Annotation?
Hello Wayne,
There is a popup with that value, not the annotation's text: What content property are you talking about? I was talking about the PDF Content. And no, in this case you won't be able to get the text - there are only Path items there - no Text content items.
Also, determining the Rectangle Annotation's position is futile - it won't give you any information at all.
Cheers,
Alex
There is a popup with that value, not the annotation's text: What content property are you talking about? I was talking about the PDF Content. And no, in this case you won't be able to get the text - there are only Path items there - no Text content items.
Also, determining the Rectangle Annotation's position is futile - it won't give you any information at all.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Re: Determine if Text or Box is rotated for Annotation?
Hi Alex -
I get the text from the Annotation.Data.Contents
and I get the rect from Annotation.Data.get_Rect()
But you're right, other than the Rect, I cannot determine if the annotation has been rotated.
That's what I'm trying to figure out....
I get the text from the Annotation.Data.Contents
and I get the rect from Annotation.Data.get_Rect()
But you're right, other than the Rect, I cannot determine if the annotation has been rotated.
That's what I'm trying to figure out....
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Determine if Text or Box is rotated for Annotation?
Hello Wayne,
Well that's not the annotation's text, but an optional structure field that was filled by the document generator of some sort: Cheers,
Alex
Well that's not the annotation's text, but an optional structure field that was filled by the document generator of some sort: Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Re: Determine if Text or Box is rotated for Annotation?
HI Alex -
Yes, it's the output from AutoCAD when exporting to PDF.
So I guess there is no inherent way to determine the 'visual rotation'...damn.
Thanks.
Yes, it's the output from AutoCAD when exporting to PDF.
So I guess there is no inherent way to determine the 'visual rotation'...damn.
Thanks.
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Determine if Text or Box is rotated for Annotation?
Hello Wayne,
From what I see, there is no way. Taking the rectangle's width and height won't work either, because there can be several lines of narrow text or something like that.
Cheers,
Alex
From what I see, there is no way. Taking the rectangle's width and height won't work either, because there can be several lines of narrow text or something like that.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Re: Determine if Text or Box is rotated for Annotation?
Yep - been down that road already....
- Tracker Supp-Stefan
- Site Admin
- Posts: 17941
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Determine if Text or Box is rotated for Annotation?
Hello Whoit,
So there is no "text" as such at this position in the file.
The "North" word is path objects, and AutoCAD has included the rectangle with the pop-up text on top of those.
I remember in the past we had issues with those rectangles being visible (due to the way AutoCAD has incorrectly specified them) - so we had to make tweaks in our own code to not show those. Apparently in your case this rectangle holds the information you are extracting, but the rectangle itself is placed on top of the base content by AutoCAD as part of the PDF generation process, and as such is positioned in the correct orientation and will not report itself as an object that is rotated relative to the coordinate system of the page. So I really do not see a way you can detect that the text is rotated, when what is rotated is not text, and the object on top that contains the extractable "meaning" of the paths below is not rotated.
Regards,
Stefan
So there is no "text" as such at this position in the file.
The "North" word is path objects, and AutoCAD has included the rectangle with the pop-up text on top of those.
I remember in the past we had issues with those rectangles being visible (due to the way AutoCAD has incorrectly specified them) - so we had to make tweaks in our own code to not show those. Apparently in your case this rectangle holds the information you are extracting, but the rectangle itself is placed on top of the base content by AutoCAD as part of the PDF generation process, and as such is positioned in the correct orientation and will not report itself as an object that is rotated relative to the coordinate system of the page. So I really do not see a way you can detect that the text is rotated, when what is rotated is not text, and the object on top that contains the extractable "meaning" of the paths below is not rotated.
Regards,
Stefan
Re: Determine if Text or Box is rotated for Annotation?
Hi Stefan -
Yeah, that's what I was afraid of...
I was hoping it was constructed as a 'regular' annotation and the rotation was part of it.
Oh, well - I'll keep thinking...
Thanks.
Yeah, that's what I was afraid of...
I was hoping it was constructed as a 'regular' annotation and the rotation was part of it.
Oh, well - I'll keep thinking...
Thanks.
- Tracker Supp-Stefan
- Site Admin
- Posts: 17941
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Determine if Text or Box is rotated for Annotation?
Hello whoit,
In this particular case and file - unfortunately it is not!
Sorry that we could not help further on this one! Hope you will figure it out!
Cheers,
Stefan
In this particular case and file - unfortunately it is not!
Sorry that we could not help further on this one! Hope you will figure it out!
Cheers,
Stefan
Re: Determine if Text or Box is rotated for Annotation?
Me too!
It'll probably have to be something related to rect size and contents, although
I'm doing that now and have found issues (Alex pointed out the issue earlier...)
It'll probably have to be something related to rect size and contents, although
I'm doing that now and have found issues (Alex pointed out the issue earlier...)
- Tracker Supp-Stefan
- Site Admin
- Posts: 17941
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Determine if Text or Box is rotated for Annotation?
Thanks for the update Whoit,
Hope the alternative approaches you are working on will allow you to achieve the needed result!
Cheers,
Stefan
Hope the alternative approaches you are working on will allow you to achieve the needed result!
Cheers,
Stefan