Delete all notes in comments?

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

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

Post Reply
chappy72
User
Posts: 13
Joined: Tue Nov 28, 2017 3:49 pm

Delete all notes in comments?

Post by chappy72 » Fri Jul 13, 2018 10:12 am

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

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

Re: Delete all notes in comments?

Post by Tracker Supp-Stefan » Fri Jul 13, 2018 10:40 am

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 » Fri Jul 13, 2018 10:51 am

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

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

Re: Delete all notes in comments?

Post by Tracker Supp-Stefan » Fri Jul 13, 2018 11:33 am

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 » Fri Jul 13, 2018 12:15 pm

Hi Stefan

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

Best wishes
Daniel

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

Re: Delete all notes in comments?

Post by Tracker Supp-Stefan » Fri Jul 13, 2018 12:27 pm

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 » Fri Jul 13, 2018 12:29 pm

thank you:-)

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

Re: Delete all notes in comments?

Post by Tracker Supp-Stefan » Fri Jul 13, 2018 12:33 pm

:)

Post Reply