How to remove annotations from a pdf file

This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-Tools SDK of Library DLL functions(only) - Please use the PDF-XChange Drivers API SDK Forum for assistance with all PDF Print Driver related topics or PDF-XChange Viewer SDK if appropriate.

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

Post Reply
m.holik
User
Posts: 21
Joined: Tue Dec 20, 2011 5:47 pm

How to remove annotations from a pdf file

Post by m.holik » Wed Aug 15, 2012 8:07 pm

Hi
Here is what I would like to do.
I have a pdf file (file A) with annotations. I have to insert this file A into another pdf document (document B) without annotations. Can you tell me how I can remove the annotations programatically? Thanks, appreciate your help.

User avatar
Paul - Tracker Supp
Site Admin
Posts: 4885
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: How to remove annotations from a pdf file

Post by Paul - Tracker Supp » Wed Aug 15, 2012 8:38 pm

Hi m.holik,

you can't remove the comments programmatically with the end user products. The easiest way t use the End user products is actually to use the PDF-Xchange Viewer, open the Comments Pane (CTRL+M) --> Group the comments by your choice --> Delete

To make it easy to select all comments choose a group by that covers all the comments if possible. Until V3 you will not be able to select multiple comments any other way and this way you can only select all comments in a group. It's a little clunky but can be done.

Now if you really do mean programmatically - that's another story, an SDK story. Should we go there?

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

m.holik
User
Posts: 21
Joined: Tue Dec 20, 2011 5:47 pm

Re: How to remove annotations from a pdf file

Post by m.holik » Wed Aug 15, 2012 8:45 pm

yes I do have to do it programatically. Can you please tell me the SDK story?

Nico - Tracker Supp
User
Posts: 220
Joined: Fri May 18, 2012 8:41 pm

Re: How to remove annotations from a pdf file

Post by Nico - Tracker Supp » Wed Aug 15, 2012 8:59 pm

Hi m.holik,

Thank you for your post.
You cannot remove the annotations for the document but you can set their properties to Invisible, Hidden or NoView by passing the PXC_CommonAnnotInfo structure with the appropriate flags to the function PXCp_SetAnnotsInfo. Please take a look at PXC_CommonAnnotInfo and PXCp_SetAnnotsInfo at PDF-Tools SDK Manual.
Thanks.

Sincerely,

m.holik
User
Posts: 21
Joined: Tue Dec 20, 2011 5:47 pm

Re: How to remove annotations from a pdf file

Post by m.holik » Wed Aug 15, 2012 9:01 pm

Thanks, will look it up

Lzcat - Tracker Supp
Site Admin
Posts: 711
Joined: Thu Jun 28, 2007 8:42 am

Re: How to remove annotations from a pdf file

Post by Lzcat - Tracker Supp » Thu Aug 16, 2012 5:55 am

Hi m.holik.
Be aware that hidden annotations will be copied into destination document and still will be accessible.
Yo ucan completely remove annotations, but this will require using the Low-Level API. Please see this topic for details: http://www.tracker-software.com/forum3/ ... 44&t=13668
Victor
Tracker Software
Project manager

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.

m.holik
User
Posts: 21
Joined: Tue Dec 20, 2011 5:47 pm

Re: How to remove annotations from a pdf file

Post by m.holik » Thu Aug 16, 2012 6:15 pm

Hi
I tried the lower level code you posted for clearing the annotation dictionary, I did not get any errors, but I see the pdf file still has the annotations.
I can email you my code snippet and pdf file if you would like.
Thanks for your help.

Nico - Tracker Supp
User
Posts: 220
Joined: Fri May 18, 2012 8:41 pm

Re: How to remove annotations from a pdf file

Post by Nico - Tracker Supp » Thu Aug 16, 2012 6:22 pm

Hi m.holik,

Thank you for your post.
Yes, feel free to send us your code at support@tracker-software.com.
Thanks.
Sincerely,

m.holik
User
Posts: 21
Joined: Tue Dec 20, 2011 5:47 pm

Re: How to remove annotations from a pdf file

Post by m.holik » Thu Aug 16, 2012 6:25 pm

I emailed it a few minutes ago.
Thanks.

Nico - Tracker Supp
User
Posts: 220
Joined: Fri May 18, 2012 8:41 pm

Re: How to remove annotations from a pdf file

Post by Nico - Tracker Supp » Thu Aug 16, 2012 10:30 pm

Hi m.holik,

Thanks for your post.
I have replied to one of your colleagues (Usha) I believe, by email.
Is this person your colleague? The question is the same.
Thanks.

Sincerely,

m.holik
User
Posts: 21
Joined: Tue Dec 20, 2011 5:47 pm

Re: How to remove annotations from a pdf file

Post by m.holik » Fri Aug 17, 2012 1:15 pm

Yes, I (Usha) is Mike's co worker.
I tried the Defs.PXCp_DictionaryClearValue(dictionaryHandle, itemKeyHandle, true) method to clear out the annotations and it works.
Thanks for your help.

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

Re: How to remove annotations from a pdf file

Post by Tracker Supp-Stefan » Fri Aug 17, 2012 1:25 pm

Hi Usha and Mike!

Great to hear that! :D

Cheers,
Stefan

jenniferolsen
User
Posts: 1
Joined: Mon Sep 17, 2012 3:48 pm

Re: How to remove annotations from a pdf file

Post by jenniferolsen » Mon Sep 17, 2012 3:53 pm

How to Delete Annotations in Adobe Acrobat?

User avatar
Paul - Tracker Supp
Site Admin
Posts: 4885
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: How to remove annotations from a pdf file

Post by Paul - Tracker Supp » Mon Sep 17, 2012 4:01 pm

HI jenniferolsen

we can't advise here on how to use competitor's software I'm afraid that would be a question to pose to Adobe don't you think?

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