fileattachment annotations

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

fabrizio
User
Posts: 33
Joined: Fri Jul 02, 2010 1:58 pm

fileattachment annotations

Post by fabrizio »

Hi, I'm evaluating your PDF-XChange Viewer SDK and I'm trying to add programmatically an external file to the page of a PDF document, as the Attachment Tool, but without any user prompt. I'm trying using javascript code but I always get a COMException. Here is the code I'm trying:

Code: Select all

this.importDataObject(myData, '/C/myFile.xml');
this.addAnnot({ page: 0, type: 'FileAttachment', point: [150,150], name: 'dataAnnotation', attachIcon: 'myData' });
Calling the first instuction via RunJavascript raises the exception.
I tried then to attach a file as described in the SDK guide, something like this:

Code: Select all

Dim vDataIn As Object = Nothing
Dim vDataOut As Object = Nothing
Dim vArr(3) As Object
vArr(0) = sFileName
vArr(1) = "AttachedFile"
vArr(2) = "prova allegato"
vDataIn = vArr
AxCoPDFXCview1.DoDocumentVerb(_iActiveDocID, Nothing, "AddAttachment", vDataIn, vDataOut)
and then calling:

Code: Select all

this.addAnnot({ page: 0, type: 'FileAttachment', point: [150,150], name: 'dataAnnotation', attachIcon: 'AttachedFile' });
to link the attachment to the annotation. The file is properly attached and the annotation icon is showed but I can not link the two toghether.

Can you please tell me where I'm wrong? Is it possible to create a FileAttachment annotation programmatically?
Thank you,
Fabrizio
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: fileattachment annotations

Post by Stefan - PDF-XChange »

Hello Fabrizio,

I have asked the guys from the dev team to have a look here and they will advise shortly.

Best,
Stefan
fabrizio
User
Posts: 33
Joined: Fri Jul 02, 2010 1:58 pm

Re: fileattachment annotations

Post by fabrizio »

Thank you :wink:
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: fileattachment annotations

Post by Stefan - PDF-XChange »

Hello Fabrizio,

The good news is that it will be fixed.
The bad is that it might be a bit too late for build 55, but it will certainly be fixed in build 56.

Kind Regards,
Stefan
fabrizio
User
Posts: 33
Joined: Fri Jul 02, 2010 1:58 pm

Re: fileattachment annotations

Post by fabrizio »

ok... Is 56 planned to be released before the end of september?
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: fileattachment annotations

Post by Stefan - PDF-XChange »

Hi Fabrizio,

Yes, as far as I am aware.

Best,
Stefan
fabrizio
User
Posts: 33
Joined: Fri Jul 02, 2010 1:58 pm

Re: fileattachment annotations

Post by fabrizio »

thank you
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: fileattachment annotations

Post by Stefan - PDF-XChange »

:)
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3586
Joined: Thu Jul 08, 2004 10:36 pm

Re: fileattachment annotations

Post by Ivan - Tracker Software »

I did implement JS functions importDataObject, createDataObject, exportDataObject for document object in build 2.0.55.
But in JS there are no way to create FileAttachment annotation linked with data object.
PDF-XChange Co Ltd. (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
fabrizio
User
Posts: 33
Joined: Fri Jul 02, 2010 1:58 pm

Re: fileattachment annotations

Post by fabrizio »

Hi Ivan, thank you for the reply. In JS there is no way to create a FileAttachment annotation linked to a data object, but is there a way to create a new FileAttachment annotation via code?
I mean is there a method like the one used for creating Highlight annotations:
DoVerb("Documents[0].Pages[0].Text", "Highlight", vDataIn, vDataOut, 0)
or a JS parameter to pass to addAnnot in order to create this kind of annotation?
I searched in the ActiveX SDK manual and in the JS for Adobe manual but can't find a working solution.
Can you help me?
Thank you.
Fabrizio
User avatar
Paul - PDF-XChange
Site Admin
Posts: 7371
Joined: Wed Mar 25, 2009 10:37 pm

Re: fileattachment annotations

Post by Paul - PDF-XChange »

Hi again fabrizio,

Ivan has said that there is no way to do this with AX/JS.

sorry :-(
Best regards

Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
fabrizio
User
Posts: 33
Joined: Fri Jul 02, 2010 1:58 pm

Re: fileattachment annotations

Post by fabrizio »

Thank you. So there is no way to programmatically do what the file attachment tool (pushpin) does? I would like to put a fileattachment annotation on the page in a given position without asking the user for file path. No way for this?
Thank you again.
Fabrizio
User avatar
Paul - PDF-XChange
Site Admin
Posts: 7371
Joined: Wed Mar 25, 2009 10:37 pm

Re: fileattachment annotations

Post by Paul - PDF-XChange »

Sorry,

for now there is no such way to do this, it is not supported in the JS or AX specifications. Sorry.
Best regards

Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com