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, Chris - Tracker Supp, Sean - Tracker, 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: 127
Joined: Fri Jun 25, 2010 6:54 am

Core Api Attachments Extract

Post by edvschu »

Hello,

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

Regards,
edvschu
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Core Api Attachments Extract

Post by Sasha - Tracker Dev Team »

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
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
edvschu
User
Posts: 127
Joined: Fri Jun 25, 2010 6:54 am

Re: Core Api Attachments Extract

Post by edvschu »

I see no IAFS_Inst Interface in Object Catalog. I'm confused :shock: .
edvschu
User
Posts: 127
Joined: Fri Jun 25, 2010 6:54 am

Re: Core Api Attachments Extract

Post by edvschu »

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: 17818
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Core Api Attachments Extract

Post by Tracker Supp-Stefan »

Hello again edvschu,

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

Regards,
Stefan
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom
Contact:

Re: Core Api Attachments Extract

Post by John - Tracker Supp »

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: 127
Joined: Fri Jun 25, 2010 6:54 am

Re: Core Api Attachments Extract

Post by edvschu »

Hello,

how close is the next build?

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

Re: Core Api Attachments Extract

Post by Tracker Supp-Stefan »

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: 127
Joined: Fri Jun 25, 2010 6:54 am

Re: Core Api Attachments Extract

Post by edvschu »

Hi Stefan,

that sounds good :wink: .

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

Re: Core Api Attachments Extract

Post by Tracker Supp-Stefan »

:)
Post Reply