annotation fillColor returning T instead of color

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

jdknox
User
Posts: 17
Joined: Mon Aug 22, 2011 10:59 pm

annotation fillColor returning T instead of color

Post by jdknox »

I'm running into one challenge with the javascript interface...specifically with annotations. I am doing a proof of concept for my company using your SDK and It is a requirement to be able to export and retrieve annotations (via attributes). I’m having a problem retrieving an annotation attribute called “fillColor”. It always returns “T” as a value (which the adobe sdk defines as transparent). I’ve pasted in a recreation of the problem below. Please let me know if I am doing anything incorrect or if there is a work-around.

Thanks, John.



1) using the tracker sample program called “c# javascript demo” (located in the viewer sdk) I create an annotation using the following java script…

this.addAnnot({ author: "r102121",type: "FreeText",name: "9c2d2f20-3973-4ee3-a353d249ec942452",page: 0,rect: [379.5,657.75,534.75,718.5],contents: "green test",creationDate: "Mon Aug 22 2011 14:20:28 GMT-0700 (Pacific Daylight Time)",fillColor:color.green});

2) Next, I retrieve the annotation using the same sample program with the following java script…

var output;
var annots = this.getAnnots({ nPage:0 });
for (var i = 0; i < annots.length; i++)
{
output += "Author=" + annots.author + ",";
output += "Type=" + annots.type + ",";
output += "Index=" + i + ",";
output += "Rect=" + annots.rect + "," ;
output += "Contents=" + annots.contents + "," ;
output += "Opacity=" + annots.opacity + "," ;
output += "FillColor=" + annots.fillColor + "," ;
this.Results = output;
}

The results from step#1 are as expected (a green annotation). However, the results from step #2 just returns fillColor: T (see below for full results to step #2).

Author=r102121,Type=FreeText,Index=0,Rect=379.5,657.75,534.75,718.5,Contents=green test,Opacity=1,FillColor=undefined,Author=r102121,Type=FreeText,Index=0,Rect=379.5,657.75,534.75,718.5,Contents=green test,Opacity=1,FillColor=T,Author=r102121,Type=FreeText,Index=0,Rect=379.5,657.75,534.75,718.5,Contents=green test,Opacity=1,FillColor=T (it’s displays green after creating the anno (step#1) but returns "T" when requesting in step#2…see above creation javascript)
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19885
Joined: Mon Jan 12, 2009 8:07 am

Re: annotation fillColor returning T instead of color

Post by Stefan - PDF-XChange »

Hello John,

The fillColor is an array, and as such the conversion to text will return weird results as you have observed.

Please check the JS API Reference for Acrobat pages 193 onwards for the color arays, and the available methods - I am afraid that a conversion to text is not available directly, so you might need to code that yourself.

Best,
Stefan
jdknox
User
Posts: 17
Joined: Mon Aug 22, 2011 10:59 pm

Re: annotation fillColor returning T instead of color

Post by jdknox »

I did look at fillColor[1] (second element in a possible array) and it was undefined. That being said, I'm not sure I understand why it's set to a transparent state when it is color and why a transparent state (aka "T") would need to have color arguments in the array. I'd expect to see green or an RGB array in the example I sent. How does your tracker activex control get the fillColor for the freetext annotation? The main reason we'd like to use the tracker pdf viewer control is to provide a unified viewer and annotation tool for our ecm product...in other words saving annotations is important from our usecase perspective. The javascript sample I sent is the easiest way to illustrate my question. It just takes a min to run through it using your sample pgm.
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19885
Joined: Mon Jan 12, 2009 8:07 am

Re: annotation fillColor returning T instead of color

Post by Stefan - PDF-XChange »

Thanks John,

I was also puzzled by the "T" returned, and have asked already the guys in our dev team to check this topic.
We will post the answers directly here in the forums.

Best,
Stefan
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3586
Joined: Thu Jul 08, 2004 10:36 pm

Re: annotation fillColor returning T instead of color

Post by Ivan - Tracker Software »

The issue with getting strokeColor and fillColor properties of some kind of annotations is fixed now.
The fix will be available in next build.
PDF-XChange Co Ltd. (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
jdknox
User
Posts: 17
Joined: Mon Aug 22, 2011 10:59 pm

Re: annotation fillColor returning T instead of color

Post by jdknox »

Terrific, thank you! Is there an eta for this release (or a place I can look to find future release dates)?
User avatar
John - Tracker Supp
Site Admin
Posts: 5223
Joined: Tue Jun 29, 2004 10:34 am

Re: annotation fillColor returning T instead of color

Post by John - Tracker Supp »

Approx 10-14 days ...

Thanks for your patience. :)
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
jdknox
User
Posts: 17
Joined: Mon Aug 22, 2011 10:59 pm

Re: annotation fillColor returning T instead of color

Post by jdknox »

sounds good. thanks again
User avatar
John - Tracker Supp
Site Admin
Posts: 5223
Joined: Tue Jun 29, 2004 10:34 am

Re: annotation fillColor returning T instead of color

Post by John - Tracker Supp »

Pleasure :)
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com