Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Interactive PDF - 'Browse' or 'Add Attachment' Button

New Here ,
Aug 08, 2016 Aug 08, 2016

HI, I'm trying to work out how to add a button to an interactive PDF so students can attach photos. I've found a few examples which attach files to the PDF under "Attachments," but my problem is that students will be attaching multiple photos and when marking the document, I need a way for them to be identified. When they are showing under "Attachments," the name is just the file name. Can I either customise the name automatically when they are attached, or have the files linked to be opened n the same page they wee attached?

The javascript I have found which browses and attaches, but does not uniquely name or store files:

if (app.viewerVersion < 11) {

  import_pre_11();

} else {

  import_11();

}

TOPICS
Acrobat SDK and JavaScript
1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 08, 2016 Aug 08, 2016

What you found is very partial. You're missing the most important part of the code (the import_pre_11 and import_11 functions themselves)...

Are your users going to be using Adobe Acrobat (ie, not the free Reader) to fill in these files? If not, what you're asking for is not possible, unless a very special right is first applied to your file.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 08, 2016 Aug 08, 2016

Yeah, I haven't done any extensive testing. Just providing a piece of script I'e found which was working for me upon very brief testing.

The users will be using Acrobat Reader

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 08, 2016 Aug 08, 2016

In that case it's a no-starter. The only way they can attach files (again, unless you apply this very special right to the file) is by using the Attach File commenting tool, and then you have no way of changing the file name of the attached files.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 09, 2016 Aug 09, 2016
LATEST

That code is from a demo file I provided: http://acroscript.net/pdf/demos/importFileJS_v1.pdf

It works with Reader 11 and later and prompts the user to select a file to be attached and doesn't require any usage rights. Although you are not able to change the file name, you can set the "name" and "contents" property of the file attachment. The name property doesn't show in the attachments panel, but the contents appears as the Description. You could use a script to display the attachments and include the name property though.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines