Forms - Execute a command - AddFileAttachment

Forum for the PDF-XChange Editor - Free and Licensed Versions

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

User avatar
Peter2
User
Posts: 958
Joined: Mon Sep 13, 2010 10:09 am

Forms - Execute a command - AddFileAttachment

Post by Peter2 »

Hi

can "AddFileAttachment" be configured, like default path to open or open only files per extension JPG"?

Have a fine Monday!
PDF-X-Change Pro German
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: Forms - Execute a command - AddFileAttachment

Post by Stefan - PDF-XChange »

Hello Peter2,

Are you using an Image form field? Or trying to add a file attachment to the file via code?
If you use the image field - then your users will be able to click and add an image - but that could also be e.g. from a PDF file. But I do not think there's a way to filter what is shown to the users.

As for the addFileAttachment - it's also a privileged command - so it will run from the command prompt but might not run if called from a form field.

Kind regards,
Stefan
User avatar
Peter2
User
Posts: 958
Joined: Mon Sep 13, 2010 10:09 am

Re: Forms - Execute a command - AddFileAttachment

Post by Peter2 »

Hi Stefan

I'm not sure if I understand the features of an "image form" .

When I add an image form, it contains automatically the javascript-code "event.target.buttonImportIcon();" This imports an image, selected by the user, but it is integrated into the PDF and can not exported with other data from forms.
Right?

So I added the "execute a command" option with "AddFileAttachment", and now I can add "imageA" to the form and "imageB" (or again Image A) to the file attachment.

Both works as single commands and as double-commands; if it makes sense can be discussed.

But the main question (or answer): "AddFileAttachment" has no further definitions for defaults - right?
PDF-X-Change Pro German
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 11566
Joined: Wed Jan 03, 2018 6:52 pm

Re: Forms - Execute a command - AddFileAttachment

Post by Daniel - PDF-XChange »

Hello, Peter2
Peter2 wrote: Mon Oct 17, 2022 3:10 pm This imports an image, selected by the user, but it is integrated into the PDF and can not exported with other data from forms.
Right?
You have that right, there is currently no way to export the images embedded as an icon inside a button.
Peter2 wrote: Mon Oct 17, 2022 3:10 pm the main question (or answer): "AddFileAttachment" has no further definitions for defaults - right?
That would be correct, the command has no customizable defaults. The dev team did confirm for me however that like other "open file" features, if does remember the last used location during runtime.

Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
User avatar
Peter2
User
Posts: 958
Joined: Mon Sep 13, 2010 10:09 am

Re: Forms - Execute a command - AddFileAttachment

Post by Peter2 »

Thanks, OK for me.
PDF-X-Change Pro German
User avatar
Paul - PDF-XChange
Site Admin
Posts: 7388
Joined: Wed Mar 25, 2009 10:37 pm

Forms - Execute a command - AddFileAttachment

Post by Paul - PDF-XChange »

:)
Best regards

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