Just show annotations that match status

PDF-XChange Editor SDK for Developers

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

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Just show annotations that match status

Post by lidds »

I want to just show annotations that match Approved, Completed status. At the moment I am looking through and checking each annotation status and if it does not match deleting the annotation from the document. However this is very slow, is there a faster command to achieve what I require?

Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Just show annotations that match status

Post by Sasha - Tracker Dev Team »

Hello Simon,

Do you want to physically remove them from the document, or just hide them from the end-user so they won't be displayed?

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Just show annotations that match status

Post by lidds »

Alex,

I wish to remove them from the document.

Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Just show annotations that match status

Post by Sasha - Tracker Dev Team »

Hello Simon,

The fastest way to do this is to run through all of the annotations, check them by the given criteria, and if they needs to be removed add them to the https://sdkhelp.pdf-xchange.com/vi ... ots_delete operation input. Then execute it once and all of them will be removed.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Just show annotations that match status

Post by lidds »

Alex,

This is currently what I am doing, but my customers has documents that have over 900 annotations and this is quite slow.

If I just wanted to hide the annotations is this possible using a different command? If so, if the annotations are hidden and then I flattern and save the document to a different file name will this only flattern and save visible annotations?

Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Just show annotations that match status

Post by Sasha - Tracker Dev Team »

Hello Simon,

Sadly, hiding them won't work for you, as you want to save the document. Let's look why removing the annotations takes so much time. To figure this out lets measure the time that is needed to find the annotations and then the time that is needed to remove the annotations.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Just show annotations that match status

Post by lidds »

Alex,

I figured out what I was doing wrong. On my JS I was collecting all the annotations on the document and then looping to match the single annotation name that I wanted to get the Status of. Obviously this was repeating this loop 900 times for the document. Instead I should have just used the this.getAnnot() command as I already knew the annotation name.

Sorry to waste your time.

Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Just show annotations that match status

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply