Delete all notes in comments?

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
chappy72
User
Posts: 13
Joined: Tue Nov 28, 2017 3:49 pm

Delete all notes in comments?

Post by chappy72 »

I had accidentially activated the option that the highlighted text will be copied to the notes pop-up.

Is there a chance of deleting all notes of a selection of annotations? The annotations should remain unchanged of course.

Thanks a lot

Best wishes
Daniel
https://t.me/pump_upp
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17907
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Delete all notes in comments?

Post by Tracker Supp-Stefan »

Hello Daniel,

It might be possible with some JavaScript.
Is it all annotations that you want to clear, or only highlights?

Can you send us a sample (if the original are sensitive - prepare it with a 'safe' file - with all types of annotations as in your original file) - and I will see if I can get a JS that will do what you need.

Regards,
Stefan
chappy72
User
Posts: 13
Joined: Tue Nov 28, 2017 3:49 pm

Re: Delete all notes in comments?

Post by chappy72 »

Hi Stefan

thanks for helping!
Here you can download a small example:
https://www.officehilfe.ch/Buttimer1996.pdf

Only highlights should be cleared of the notes.

Best wishes
Daniel
https://t.me/pump_upp
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17907
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Delete all notes in comments?

Post by Tracker Supp-Stefan »

Hello chappy72,

E.g. the below will remove the text from Highlight annotations, while it will leave the sticky note ones intact:

Code: Select all

var annots = this.getAnnots();
for (var i = 0; i < annots.length; i++)
{
  if (annots[i].type == "Highlight")
  {
    annots[i].contents = '';
  }
}
Here is your file's comments pane before:
before.png
and after executing the above script:
after.png
Cheers,
Stefan
chappy72
User
Posts: 13
Joined: Tue Nov 28, 2017 3:49 pm

Re: Delete all notes in comments?

Post by chappy72 »

Hi Stefan

perfect, it works!!
Many thanks and have a nice weekend.

Best wishes
Daniel
https://t.me/pump_upp
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17907
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Delete all notes in comments?

Post by Tracker Supp-Stefan »

You too have a lovely weekend Daniel!

Cheers,
Stefan
chappy72
User
Posts: 13
Joined: Tue Nov 28, 2017 3:49 pm

Re: Delete all notes in comments?

Post by chappy72 »

thank you:-)
https://t.me/pump_upp
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17907
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Delete all notes in comments?

Post by Tracker Supp-Stefan »

:)
Post Reply