Programmatically add a file attachment to an open PDF

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

bmills
User
Posts: 6
Joined: Thu Nov 26, 2009 9:24 pm

Programmatically add a file attachment to an open PDF

Post by bmills »

Hi all,

I have been looking for a way to programmatically add a file attachment to an open PDF document in the viewer within a vb6 developed application.

The code below works fine for an interactive mode where a common Windows dialogue is triggered allowing a user to select a file. However I haven’t been able to find documentation or examples of passing a file path and file name of the attachment and have the attachment added without user intervention.

Thanks in advance for any ideas, documentation, or examples


Dim vdatain, vdataout
vdatain = 33815
vdataout = Empty
Call CoPDFXCview1.DoVerb("", "ExecuteCommand", vdatain, vdataout, PXCVA_Flags.PXCVA_NoUI)
User avatar
Paul - PDF-XChange
Site Admin
Posts: 7371
Joined: Wed Mar 25, 2009 10:37 pm

Re: Programmatically add a file attachment to an open PDF

Post by Paul - PDF-XChange »

Hi Bill,

nice to see the post working now. Someone from the dev team will look at this soon,

regards
Best regards

Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: Programmatically add a file attachment to an open PDF

Post by Vasyl - PDF-XChange »

Hi Bill,

Unfortunately, but no way for this.
Attachment cannot be added programmatically into pdf.

We can improve this feature in the new version.

Best
Regards.
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
bmills
User
Posts: 6
Joined: Thu Nov 26, 2009 9:24 pm

Re: Programmatically add a file attachment to an open PDF

Post by bmills »

Ok too bad. This ability would be useful in a newer version.

The custom application currently monitors a folder for files which have been contributed by users. These files need to be linked to already existing pdf files. If the newly contributed file is a pdf, then the process automatically appends the pages to the existing pdf without user intervention. If the newly contributed file is not a pdf, I would like to automatically add the file to the list of attachments in the pdf file without user intervention.

Thanks
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: Programmatically add a file attachment to an open PDF

Post by Vasyl - PDF-XChange »

We can add this feature into the next build.
This feature will probably have syntax like:
DoDocumentVerb(docId, NULL, "AddAttachment", dataIn(filename), NULL, 0);
Please wait for the new build.
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.