Core Api Attachments Extract  SOLVED

A forum for questions or concerns related to the PDF-XChange Core API SDK

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Chris - Tracker Supp, 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
edvschu
User
Posts: 122
Joined: Fri Jun 25, 2010 6:54 am

Core Api Attachments Extract

Post by edvschu » Thu Oct 08, 2015 10:29 am

Hello,

i want to extract all attachments from a pdf. How can i do that?

Regards,
edvschu

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

Re: Core Api Attachments Extract

Post by Sasha - Tracker Dev Team » Thu Oct 08, 2015 11:59 am

Here's the sample which you can experiment with:

Code: Select all

			IPXC_NameTree pTree =  pDoc.GetNameTree("EmbeddedFiles");
			IAFS_Inst pAInst = (IAFS_Inst)pInst.GetExtension("AFS");
			IAFS_FileSys pFSys = pAInst.DefaultFileSys;
			uint nAttachmentsCount = pTree.Count;
			string sName;
			for (uint i = 0; i < nAttachmentsCount; i++)
			{
				IPXS_PDFVariant pValue;
				pTree.Item(i, out sName, out pValue);
				IPXC_FileSpec pFS = pDoc.GetFileSpecFromVariant(pValue);
				IPXC_EmbeddedFileStream pEFS = pFS.EmbeddedFile;
				IAFS_Name pName = pFSys.StringToName(@"D:\Test" + i.ToString() + ".txt");
				IAFS_File pFile = pFSys.OpenFile(pName, (int)AFS_OpenFileFlags.AFS_OpenFile_CreateAlways | (int)AFS_OpenFileFlags.AFS_OpenFile_ShareWrite | (int)AFS_OpenFileFlags.AFS_OpenFile_Write | (int)AFS_OpenFileFlags.AFS_OpenFile_ShareRead);
				pEFS.SaveToFile(pFile);
			}
HTH
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

edvschu
User
Posts: 122
Joined: Fri Jun 25, 2010 6:54 am

Re: Core Api Attachments Extract

Post by edvschu » Thu Oct 08, 2015 12:31 pm

I see no IAFS_Inst Interface in Object Catalog. I'm confused :shock: .

edvschu
User
Posts: 122
Joined: Fri Jun 25, 2010 6:54 am

Re: Core Api Attachments Extract

Post by edvschu » Mon Oct 12, 2015 11:25 am

I can do this:

Code: Select all

Private auxInst As LIBNAME.IAUX_Inst
Private pxsInst As LIBNAME.IPXS_Inst
but no this:

Code: Select all

Private afsInst As LIBNAME.IAFS_Inst
Can anyone help?

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

Re: Core Api Attachments Extract

Post by Tracker Supp-Stefan » Mon Oct 12, 2015 11:52 am

Hello again edvschu,

This will be fixed in next build.
For the moment you could try to use the Editor SDK dll.

Regards,
Stefan

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Re: Core Api Attachments Extract

Post by John - Tracker Supp » Thu Oct 15, 2015 2:55 pm

Please post your Core API Questions in the correct forum to avoid confusion and delays

Thanks - we will move as appropriate.

thanks
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
Tracker Support
http://www.tracker-software.com

edvschu
User
Posts: 122
Joined: Fri Jun 25, 2010 6:54 am

Re: Core Api Attachments Extract

Post by edvschu » Thu Nov 05, 2015 7:44 am

Hello,

how close is the next build?

Best Regards,
edvschu

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

Re: Core Api Attachments Extract

Post by Tracker Supp-Stefan » Thu Nov 05, 2015 1:00 pm

Hello edvschu,

We do not have any fixed date yet, but the idea currently is to have the new build out before the festive season if all goes well and we are ready with all the things planned for it.

Regards,
Stefan

edvschu
User
Posts: 122
Joined: Fri Jun 25, 2010 6:54 am

Re: Core Api Attachments Extract

Post by edvschu » Thu Nov 05, 2015 1:12 pm

Hi Stefan,

that sounds good :wink: .

Regards,
edvschu

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

Re: Core Api Attachments Extract

Post by Tracker Supp-Stefan » Thu Nov 05, 2015 1:22 pm

:)

Post Reply