Skip to main content
This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

robertt87769452
Participating Frequently
November 26, 2019

OK, here's what I got so far:

 

this.syncAnnotScan();
var annots = this.getAnnots();
for (var i = 0; i < annots.length; i++)
if (annots[i].type == "Circle" || "Square") annots[i].width = 2, annots[i].fillColor = color.transparent;

 

Now there is just one issue with this script, it also somehow applies the properties to polygon objects. When I run the script individually for circle and square, it works fine. When both are listed as above, the polygon gets changed, too. 

Translate
robertt87769452
Participating Frequently
November 26, 2019

OK, small syntax error. Here's the working script:

 

this.syncAnnotScan();
var annots = this.getAnnots();
for (var i = 0; i < annots.length; i++)
if (annots[i].type == "Circle" || annots[i].type == "Square") annots[i].width = 2, annots[i].fillColor = color.transparent;

Translate
Thom Parker
Community Expert
Community Expert
November 27, 2019

You are very close. 

 

this.syncAnnotScan();
var annots = this.getAnnots();
for (var i = 0; i < annots.length; i++)
{
     if (annots[i].type == "Circle" || annots[i].type == "Square")
     {
            annots[i].width = 2;
            annots[i].fillColor = ["T"];
      }
}
Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often