PDF attachment import and export

New Here ,
May 15, 2019 May 15, 2019

Copy link to clipboard

Copied

I am using the file at https://www.pdfscripting.com/public/FreeStuff/PDFSamples/ImExportAttachSample.pdf for uploading and downloading attachments. But when downloading the attachments the extension is getting lost. So, how to retain the extension? I am uploading files with extensions like docx, png, jpeg, xls, etc

I am open to other suggestions to for uploading and downloading attachment to pdf file.

TOPICS
Acrobat SDK and JavaScript, Windows

Views

267

Likes

translate

Translate

Translate

Report

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
Adobe Community Professional ,
May 16, 2019 May 16, 2019

Copy link to clipboard

Copied

What can you see in the attachment panel?

Likes

translate

Translate

Translate

Report

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 ,
May 16, 2019 May 16, 2019

Copy link to clipboard

Copied

Annotation 2019-05-16 093217.pngAnnotation 2019-05-16 093403.png

as you can see from the 2nd screenshot when clicking on "export an attachment" the windows dialog box doesnt have any extension shown after file name or even the "save as type" doesn't have any type selected.

any solution for the above?

Likes

translate

Translate

Translate

Report

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
Adobe Community Professional ,
May 16, 2019 May 16, 2019

Copy link to clipboard

Copied

In Windows Explorer enable the option 'File name extensions':

https://www.msftnext.com/show-file-extensions-windows-10-explorer/

Likes

translate

Translate

Translate

Report

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
Adobe Community Professional ,
May 16, 2019 May 16, 2019

Copy link to clipboard

Copied

Thanks JR, that sample is probably 15 years old, but still working

Bernd is correct. Windows is trying to out think the user, because MS figures users have no idea what they are doing. Unfortunately this gets in the way of simple items like file extensions, and getting into the folders where Acrobat stores most everything useful.

I have a full discussion on this topic in this article on installing Acrobat automation scripts.

Instructions for Installing Folder Level Scripts (Automation Tools) and Plug-ins

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Likes

translate

Translate

Translate

Report

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 ,
May 16, 2019 May 16, 2019

Copy link to clipboard

Copied

Thom ParkerBernd Alheit​ @JR_Boulay What is the best way to handle attachments? I mean through javascript and use of buttons. I dont want user to open attachments panel as some of my clients don't know that on how and what to do. So is there anything through which we can open attachments panes for the documents to show? like right click --> show menu and on clicking one of the menu item attachments panel gets opened?

Likes

translate

Translate

Translate

Report

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
Adobe Community Professional ,
May 16, 2019 May 16, 2019

Copy link to clipboard

Copied

You can use this script to open the attachment panel

if(this.dataObjects && this.dataObjects.length)

   this.viewState = {overViewMode:7};

else

   app.alert("No Attached files",1);

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Likes

translate

Translate

Translate

Report

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
Adobe Community Professional ,
May 16, 2019 May 16, 2019

Copy link to clipboard

Copied

With all due respect to Thom, one of our great masters, it must be acknowledged that this document is a little outdated now that Reader (since version XI) allows to use Commenting tools without limitation.

You will find a great tuto here with a sample PDF (chapter 5):

- in French : https://www.abracadabrapdf.net/?p=4295

- in Google-English : https://translate.google.fr/translate?sl=fr&tl=en&u=https%3A%2F%2Fwww.abracadabrapdf.net%2Fressource...

(You can set the Pin icon coordinates outside of the page if you don't want users to see it)

Likes

translate

Translate

Translate

Report

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