Page 1 of 1

Change Text Box properties on entire document

Posted: Fri Feb 08, 2013 9:00 am
by Muppet Rat
I have a 50+ page document with a lot of copy & pasted text boxes throughout. All the boxes have a red border which I would like to change to a more subtle colour. Is there any way I can change all the boxes in the document at once without having to go to the properties of each one individually?
TIA

Re: Change Text Box properties on entire document

Posted: Fri Feb 08, 2013 9:38 am
by Tracker Supp-Stefan
Hello Muppet Rat,

You could achieve this with some JavaScript.
To open the JS console in the Viewer press Ctrl-J, and then copy and paste this code there:

Code: Select all

var annots = this.getAnnots();
for(i = 0; i < annots.length; i++){
  if (annots[i].type == "FreeText"){
    annots[i].strokeColor = ["RGB", 1, 0.5, 0.7];
  }
}
This will make all free text annotations with pink border. If you want another colour you can change the Red, Green and Blue values accordingly.

Best,
Stefan

Re: Change Text Box properties on entire document

Posted: Fri Feb 08, 2013 2:32 pm
by Muppet Rat
Hi Stefan,
Thanks for that. It "sort" of worked. It's made the boxes vanish, and the colour I chose shows up when the box is selected.
All good though - the scary red all over the doc has gone 8)
Thanks again :wink:

Re: Change Text Box properties on entire document

Posted: Fri Feb 08, 2013 2:34 pm
by Tracker Supp-Stefan
Hi Muppet Rat,

It should not be making them vanish!
So please make sure you have the latest build of our Viewer first (2.5.208):
www.tracker-software.com/PDFXVwer.zip
After that try exporting all comments to a data file, delete all comments from a copy of the file, import the ones you exported earlier and then try running the script again!

Best,
Stefan

Re: Change Text Box properties on entire document

Posted: Sun Feb 10, 2013 4:56 am
by Muppet Rat
Tracker Supp-Stefan wrote: After that try exporting all comments to a data file, delete all comments from a copy of the file, import the ones you exported earlier and then try running the script again!
I'm not sure I understand that, do you mean "Export all settings to data file"? By "comments" do you mean the pasted blocks of text?

Since putting in the script, new blocks of text have the coloured border, just not the earlier ones.

Re: Change Text Box properties on entire document

Posted: Mon Feb 11, 2013 1:24 am
by Paul - Tracker Supp
Hi Muppet Rat,
I'm not sure I understand that, do you mean "Export all settings to data file"? By "comments" do you mean the pasted blocks of text?
He means use the command in the Comments menu to export and import the comments to/from a file.

Comments --> Export Comments to Data File... and Comments --> Import Comments

hth