Get strokecolor of selected Polygon

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

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Chris - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software

Post Reply
magthenop
User
Posts: 43
Joined: Tue Sep 07, 2010 8:35 am

Get strokecolor of selected Polygon

Post by magthenop » Thu May 18, 2017 9:50 am

Hi!

How can I get the strokecolor of a selected Polygon?

i have tried with a number of things,
This is the latest (but it does not work):

'a = this.selectedAnnots; if (a.length) { var p = a[0].getProps(); p.strokecolor; };';

I am executing this string with RunJavaScript and want to get a string in return that I can use on another object.

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13524
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Get strokecolor of selected Polygon

Post by Tracker Supp-Stefan » Thu May 18, 2017 10:28 am

Hello magthenop,

Properties names are case sensitive. The below (executed in the end user Editor through the JS console, does print out "RGB,1,0,0" for a selected polygon object with red colour:

Code: Select all

a = this.selectedAnnots; if (a.length) { var p = a[0].getProps(); p.strokeColor; };
console.println(p.strokeColor);
Regards,
Stefan

magthenop
User
Posts: 43
Joined: Tue Sep 07, 2010 8:35 am

Re: Get strokecolor of selected Polygon

Post by magthenop » Thu May 18, 2017 11:04 am

:-) Jepp, that did the trick!
Thanks

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13524
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Get strokecolor of selected Polygon

Post by Tracker Supp-Stefan » Thu May 18, 2017 11:49 am

:)

Post Reply