We are currently extracting and restoring annotations off of a pdf. We just have one challenge...Here are the steps...
1) Customer adds annotation using textbox tool
2) They size the text down using the "text formatting" then "subscript"
3) on close or next event we programatically save this annotation in a db (see code below as example) using your javascript interface
4) when we restore it from the db on the pdf (using the java script interface), the font is back to default instead of the size it was saved at. This occurs even if they change their client default via the ini.
This brings me to the question....
what annotation attribute is used to persist the font size of the text box tool annotation?
If none, can a client default setting be used to override this? (by default, the font reduction only works for new annos created and not restored via the javascript api).
ps..btw, my last post is similar (except related to color instead of font size) and you guys had a terrific answer/fix that got is working quickly.
------------------------------
Here is sample code that pulls the attributes of the annotation (via java script example)...
var output="";
var annots = this.getAnnots();
if(annots==null)
output="None";
else
for (var i = 0; i < annots.length; i++)
{
var anno = annots;
if (( anno.type == "Text" || anno.type =="FreeText" || anno.type == "Highlight"))
{
if(output.length > 0)
output += "|" ;
var p = anno.getProps();// get the properties of first one
for ( o in p ) {
if(output.length > 0)
output += "|" ;
output += o + " : " + p[o]
}
}
}
this.results=output;
Retrieving font size annotation attrib using java script...
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
- User
- Posts: 17
- Joined: Mon Aug 22, 2011 10:59 pm
-
- Site Admin
- Posts: 19913
- Joined: Mon Jan 12, 2009 8:07 am
Re: Retrieving font size annotation attrib using java script
Hello jdknox,
I believe this information should be in the textSize and textFont properties, but using your script I get "undefined" as the value for both even when I've changed the font and size to differ from the default.
We will now discuss this further and post again here when we have any further news.
Best,
Stefan
I believe this information should be in the textSize and textFont properties, but using your script I get "undefined" as the value for both even when I've changed the font and size to differ from the default.
We will now discuss this further and post again here when we have any further news.
Best,
Stefan
-
- User
- Posts: 17
- Joined: Mon Aug 22, 2011 10:59 pm
Re: Retrieving font size annotation attrib using java script
Thanks for looking at this. I had looked at those attributes too and got the same "undefined" as you did. I did not want to lead you down any particular path so I did not include that info. I appreciate your time on this!
-
- Site Admin
- Posts: 7371
- Joined: Wed Mar 25, 2009 10:37 pm
Re: Retrieving font size annotation attrib using java script
Hi jdknox,
I'm afraid this cannot be done in V2.5 for now.
textFont and textSize is not the option you need. The property you want is richContent which in 2.5 you can get but cannot set.
We can add this functionality, hopefully in the next build. I have raised a Support Request Ticket RT#1492: Retrieving font size annotation attrib using java script... and the devs will attempt to implement 'set' for this property in the next build.
hth
I'm afraid this cannot be done in V2.5 for now.
textFont and textSize is not the option you need. The property you want is richContent which in 2.5 you can get but cannot set.
We can add this functionality, hopefully in the next build. I have raised a Support Request Ticket RT#1492: Retrieving font size annotation attrib using java script... and the devs will attempt to implement 'set' for this property in the next build.
hth
Best regards
Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
-
- User
- Posts: 17
- Joined: Mon Aug 22, 2011 10:59 pm
Re: Retrieving font size annotation attrib using java script
Thank you for the research and adding the request. Saving and restoring a reduced font size is the main goal of our customers because the font is pretty large with the tracker viewer default. Is their a place I can look to see if RT#1492 is being considered by the devs for a release/eta or should I just check back here?
-
- Site Admin
- Posts: 19913
- Joined: Mon Jan 12, 2009 8:07 am
Re: Retrieving font size annotation attrib using java script
Hi jdknox,
Those tickets are for internal use only, but we do keep track of them and will update this topic as soon as there is any info in the ticket. And inside the ticket I can already see that it's target is set to build 202 (the very next).
Best,
Stefan
Those tickets are for internal use only, but we do keep track of them and will update this topic as soon as there is any info in the ticket. And inside the ticket I can already see that it's target is set to build 202 (the very next).
Best,
Stefan
-
- User
- Posts: 17
- Joined: Mon Aug 22, 2011 10:59 pm
Re: Retrieving font size annotation attrib using java script
thanks for the update and for such a quick response. terrific service as usual.
-
- Site Admin
- Posts: 19913
- Joined: Mon Jan 12, 2009 8:07 am