Removing Author's Name in Comments  SOLVED

Forum for the PDF-XChange Editor - Free and Licensed Versions

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

Post Reply
qlaus
User
Posts: 11
Joined: Tue Feb 20, 2018 3:02 pm

Removing Author's Name in Comments

Post by qlaus »

Hi, I'm looking for advice how I can remove the names of the authors of comments before sending the commented document to a business partner. I.e. Author A, B, and C have been commenting, however, we do not want to show the recipient of the commented document who has been commenting. Any chance to remove all the names? Save as optimized did not help.

Editor Plus, Version 6.0 322.7 on Win7, Corporate version, managed device -> "please upgrade to the latest version 7.whatever" wouldn't help me

Thanks for your support
User avatar
Paul - Tracker Supp
Site Admin
Posts: 6833
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: Removing Author's Name in Comments

Post by Paul - Tracker Supp »

Hi qlaus,

welcome to the forums and thanks for the excellent question.

You can go into the comment properties and remove the comment Author. Use CTRL+` (that is the 'back tick' character that is to the left of the 1 on a US keyboard) or right click the comment and choose 'properties'.

What kind of comments are they and how many do you have? How is your JavaScript? I suspect you could write a script to auto mate that. Also, you may want to copy the file before doing this so as to keep the names of the authors for future reference.

I hope that helps.
Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
qlaus
User
Posts: 11
Joined: Tue Feb 20, 2018 3:02 pm

Re: Removing Author's Name in Comments

Post by qlaus »

Hello Paul,

thanks for the fast reply.
- removing the names manually in each comment, highlight, strikethrough, whatever is not an option. I do have a document of about 150 pages with an average of let's say 3 comments per page
- my JavaScript is simply not existing :-(, no clue
- MS Word has the option "inspect document", which can remove all personal data when using the review mode, which is quite convenient. Iv'e been looking for something alike

Cheers
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8436
Joined: Wed Jan 03, 2018 6:52 pm

Re: Removing Author's Name in Comments

Post by TrackerSupp-Daniel »

Hi qlaus,
Do you know anyone with javascript knowledge that could help you with it? much like Paul said it would certainly be possible with a simple script.
If you do, the reference for them is right here: https://www.adobe.com/content/dam/acom/ ... erence.pdf
It would be simply looking for the comments, and then setting the author fields value to null, or maybe "Removed", or a company name, something of the like.

Hope that helps.
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
lev
User
Posts: 258
Joined: Fri Apr 11, 2014 1:18 am

Re: Removing Author's Name in Comments  SOLVED

Post by lev »

The script below was written to replace Author1 name with Author2. Replace Author1 with the name of the author you want to remove. If you delete Author2, leaving just the double quotes, the comments will show Unknown Author in the Comments pane. If you leave a space between the quotes, the result will be more sightly. Paste your script in Java windows (the Java window may be called up with a Ctrl+J combination) and click Run.
Let us know if you get anywhere.

Code: Select all

var annots = this.getAnnots();
for (var i = 0; i < annots.length; i++)
{ if (annots[i].author == "Author1")
    {
     annots[i].author = "Author2";
    }
}
P.S. The script was written by Stefan Dzhukelov, so credit him for the work.
qlaus
User
Posts: 11
Joined: Tue Feb 20, 2018 3:02 pm

Re: Removing Author's Name in Comments

Post by qlaus »

Hello and thanks for the help.

@lev: this works fust fine! Kudos to Stefan Dzhukelov :D

Please allow another dummy question: so far, I just found the option to save the JavaScript in the document. Would it be possible to save it "Macro like" and assign a toolbar button for general use?

Cheers
qlaus
User
Posts: 11
Joined: Tue Feb 20, 2018 3:02 pm

Re: Removing Author's Name in Comments

Post by qlaus »

Update: I successfully tried to remove the "if" query, so the script is overwriting the author regardless what value it has. Quite handy when you have several authors.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Removing Author's Name in Comments

Post by Tracker Supp-Stefan »

Hello qlaus,

Glad to hear the script is working for you.
The IF clause was there so that you can only change the name of one author and preserve the others - sometimes that could also be needed.

As for adding a "macro" - please take a look at the attached file.
rename the file from inside the archive form .txt to .js, and then place it here
%AppData%\Tracker Software\PDFXEditor\3.0\JavaScripts
(If the folder does not exist - create it)
And then restart the Editor.

You will now have a new button in the Editor's toolbars than when pressed will execute the JS from the file. Replacing the "print all" code with the one for your author rename should then allow you to use the button accordingly.

Regards,
Stefan
Attachments
printAllOpenedDocs.zip
(458 Bytes) Downloaded 76 times
qlaus
User
Posts: 11
Joined: Tue Feb 20, 2018 3:02 pm

Re: Removing Author's Name in Comments

Post by qlaus »

Stefan, you absolutely made my day! Works like a charm. Thanks for helping the dummy, that's exactly what I've been looking for!

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

Re: Removing Author's Name in Comments

Post by Tracker Supp-Stefan »

Glad to assist Qlaus :)

Cheers,
Stefan
Post Reply