exportCommentsAndFields

PDF-XChange Editor SDK for Developers

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

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: 132
Joined: Fri Aug 24, 2018 8:26 am

exportCommentsAndFields

Post by jusWest » Fri Apr 16, 2021 10:45 am

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.

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

Re: exportCommentsAndFields

Post by Sasha - Tracker Dev Team » 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
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

jusWest
User
Posts: 132
Joined: Fri Aug 24, 2018 8:26 am

Re: exportCommentsAndFields

Post by jusWest » Fri Apr 16, 2021 11:27 am

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 :))

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

Re: exportCommentsAndFields

Post by Sasha - Tracker Dev Team » Fri Apr 16, 2021 11:32 am

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.tracker-software.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: 132
Joined: Fri Aug 24, 2018 8:26 am

Re: exportCommentsAndFields

Post by jusWest » Fri Apr 16, 2021 11:37 am

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?

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

Re: exportCommentsAndFields

Post by Sasha - Tracker Dev Team » Fri Apr 16, 2021 11:42 am

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: 132
Joined: Fri Aug 24, 2018 8:26 am

Re: exportCommentsAndFields

Post by jusWest » Fri Apr 16, 2021 12:34 pm

ok, thank you :)

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

exportCommentsAndFields

Post by Sasha - Tracker Dev Team » Fri Apr 16, 2021 12:35 pm

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

Post Reply