exportCommentsAndFields

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
jusWest
User
Posts: 150
Joined: Fri Aug 24, 2018 8:26 am

exportCommentsAndFields

Post by jusWest »

Hello!

We have a problem when exporting annotations to a FDF file like this:

Code: Select all

                //export to file
                var op = _Inst.CreateOp(_Inst.Str2ID("op.document.exportCommentsAndFields", false));

                op.Params.Root["Input"].v = _Inst.ActiveDoc;

                ICabNode cabNode = op.Params.Root["Options"];

                cabNode["ExportAnnots"].v = true;
                cabNode["ExportFields"].v = false;
                cabNode["IncludeEmptyFields"].v = true;
                cabNode["ExportFieldFlags"].v = true;
                cabNode["Format"].v = "FDF";

                var name = ((IAFS_Inst)_Inst.GetExtension("AFS")).DefaultFileSys.StringToName(FDFfilename, 0, (IAFS_Name)null);
                cabNode["DestFile"].v = name;

                op.Do();
We are parsing the FDF files, but because some PDF documents have a lot of attachements, the resulting FDF file often
has a lot of stream/endstream separated binary data, this causes problem for our parser.

Is it possible to avoid exporting the attachement binary data when doing this export?

We use the latest SDK.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: exportCommentsAndFields

Post by Sasha - Tracker Dev Team »

Hello jusWest,

There is no way of skipping attachments directly from the operation. However, you can make a copy of the document in memory, remove all of the attachment annotations and then do the export operation.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jusWest
User
Posts: 150
Joined: Fri Aug 24, 2018 8:26 am

Re: exportCommentsAndFields

Post by jusWest »

Sasha - Tracker Dev Team wrote: Fri Apr 16, 2021 11:19 am Hello jusWest,

There is no way of skipping attachments directly from the operation. However, you can make a copy of the document in memory, remove all of the attachment annotations and then do the export operation.

Cheers,
Alex
hmm, interresting is there an operation for removing the attachements from a document? (havent searched yet :))
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: exportCommentsAndFields

Post by Sasha - Tracker Dev Team »

Hello jusWest,

Well attachments can be in 2 separate places - Attachment Annotations on pages and the Attachment tree dictionary. What you need are the annotations, as these are being used by the export operation.
The https://sdkhelp.pdf-xchange.com/vi ... ots_delete operation can be used to remove the needed annotations.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jusWest
User
Posts: 150
Joined: Fri Aug 24, 2018 8:26 am

Re: exportCommentsAndFields

Post by jusWest »

thanks.

In the options there are the following options:

Code: Select all

1	Markup annotations.
2	Link annotations.
4	Widget annotations.
-1	All of the annotation types.

which would be the attachements?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: exportCommentsAndFields

Post by Sasha - Tracker Dev Team »

Hello jusWest,

You don't need to specify any options - just fill the input with needed annotations.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jusWest
User
Posts: 150
Joined: Fri Aug 24, 2018 8:26 am

Re: exportCommentsAndFields

Post by jusWest »

ok, thank you :)
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

exportCommentsAndFields

Post by Sasha - Tracker Dev Team »

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