Change Text Box properties on entire document

A picture is worth a thousand words. We have created some pdfs tutorials showing common tasks.

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

Post Reply
Muppet Rat
User
Posts: 6
Joined: Fri Feb 08, 2013 8:56 am

Change Text Box properties on entire document

Post 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
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17901
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Change Text Box properties on entire document

Post 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
Muppet Rat
User
Posts: 6
Joined: Fri Feb 08, 2013 8:56 am

Re: Change Text Box properties on entire document

Post 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:
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17901
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Change Text Box properties on entire document

Post 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
Muppet Rat
User
Posts: 6
Joined: Fri Feb 08, 2013 8:56 am

Re: Change Text Box properties on entire document

Post 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.
User avatar
Paul - Tracker Supp
Site Admin
Posts: 6897
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: Change Text Box properties on entire document

Post 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
Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
Post Reply