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: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, 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 »

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: 6837
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 »

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
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 »

yes I do have to do it programatically. Can you please tell me the SDK story?
Nico - Tracker Supp
User
Posts: 205
Joined: Fri May 18, 2012 8:41 pm

Re: How to remove annotations from a pdf file

Post by Nico - Tracker Supp »

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 »

Thanks, will look it up
User avatar
Lzcat - Tracker Supp
Site Admin
Posts: 677
Joined: Thu Jun 28, 2007 8:42 am

Re: How to remove annotations from a pdf file

Post by Lzcat - Tracker Supp »

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: https://forum.pdf-xchange.com/ ... 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 »

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: 205
Joined: Fri May 18, 2012 8:41 pm

Re: How to remove annotations from a pdf file

Post by Nico - Tracker Supp »

Hi m.holik,

Thank you for your post.
Yes, feel free to send us your code at support@pdf-xchange.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 »

I emailed it a few minutes ago.
Thanks.
Nico - Tracker Supp
User
Posts: 205
Joined: Fri May 18, 2012 8:41 pm

Re: How to remove annotations from a pdf file

Post by Nico - Tracker Supp »

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 »

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: 17824
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 »

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 »

How to Delete Annotations in Adobe Acrobat?
User avatar
Paul - Tracker Supp
Site Admin
Posts: 6837
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 »

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

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
Post Reply