Change Text Box properties on entire document

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

Moderators: Tracker Support, TrackerSupp-Daniel, Chris - Tracker Supp, Vasyl-Tracker Dev Team, 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 » Fri Feb 08, 2013 9:00 am

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: 13376
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Change Text Box properties on entire document

Post by Tracker Supp-Stefan » Fri Feb 08, 2013 9:38 am

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 » Fri Feb 08, 2013 2:32 pm

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: 13376
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Change Text Box properties on entire document

Post by Tracker Supp-Stefan » Fri Feb 08, 2013 2:34 pm

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 » Sun Feb 10, 2013 4:56 am

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: 4906
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 » Mon Feb 11, 2013 1:24 am

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
_________________
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

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

Post Reply