Page 1 of 1

Core Api Attachments Extract

Posted: Thu Oct 08, 2015 10:29 am
by edvschu
Hello,

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

Regards,
edvschu

Re: Core Api Attachments Extract

Posted: Thu Oct 08, 2015 11:59 am
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

Re: Core Api Attachments Extract

Posted: Thu Oct 08, 2015 12:31 pm
by edvschu
I see no IAFS_Inst Interface in Object Catalog. I'm confused :shock: .

Re: Core Api Attachments Extract

Posted: Mon Oct 12, 2015 11:25 am
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?

Re: Core Api Attachments Extract

Posted: Mon Oct 12, 2015 11:52 am
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

Re: Core Api Attachments Extract

Posted: Thu Oct 15, 2015 2:55 pm
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

Re: Core Api Attachments Extract

Posted: Thu Nov 05, 2015 7:44 am
by edvschu
Hello,

how close is the next build?

Best Regards,
edvschu

Re: Core Api Attachments Extract

Posted: Thu Nov 05, 2015 1:00 pm
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

Re: Core Api Attachments Extract

Posted: Thu Nov 05, 2015 1:12 pm
by edvschu
Hi Stefan,

that sounds good :wink: .

Regards,
edvschu

Re: Core Api Attachments Extract

Posted: Thu Nov 05, 2015 1:22 pm
by Tracker Supp-Stefan
:)