Acrobat/Reader: Attach to Email button not working for PDFs referenced from long URLs

Issue

If you are using servlets or scripts to serve your PDF files in the browser, and you then want to use the standard “Attach to Email” button on the Acrobat/Reader toolbar (also available under the File menu) to forward the PDF to another user by email, you may notice that the PDF does not get attached to the email in some situations.

Reason

When you click on the Acrobat/Reader “Attach to Email” button on the toolbar it sends a request to your default email client to compose a new message.  It will also attempt to create the PDF attachment using the file name specified in the URL where the actual PDF is stored.

The URL may be too long to create a PDF file as attachment if it contains very long parameters as follows:

http://localhost:8080/Simple_Servlet/DMShowPDF?command=getdocuments&PDF=path/123_4567890abcdefghijklmnopqrstuvwxyz_0_0.pdf&sig=0123456789abcdefghijklmnopqrstuv&ts=0123456789012&category=new&stage=EDITING%3B%3B%3B1%3B%3B%3B&docid=S0123456789abcdefghijklmnopqrst&ext=.PDF

In this case the filename of the resulting PDF attachment would be:

123_4567890abcdefghijklmnopqrstuvwxyz_0_0.pdf&sig=0123456789abcdefghijklmnopqrstuv&ts=0123456789012&category=new&stage=EDITING%3B%3B%3B1%3B%3B%3B&docid=S0123456789abcdefghijklmnopqrst&ext=.PDF

This can exceed operating system limits, and therefore the attachment does not get created/added to the email message.

Workaround

Simply reducing the length of the URL, particularly the string which will be used for the PDF attachment file name, will allow the PDF attachment to be created.  Even just reducing it by a few characters is sufficient.

Solution

A cleaner solution however, would be to re-structure the URLs so they are shorter, and/or move the PDF parameter to the last parameter position as follows:

http://localhost:8080/Simple_Servlet/DMShowPDF?command=getdocuments&sig=0123456789abcdefghijklmnopqrstuv&ts=0123456789012&category=new&stage=EDITING%3B%3B%3B1%3B%3B%3B&docid=S0123456789abcdefghijklmnopqrst&ext=.PDF&PDF=path/123_4567890abcdefghijklmnopqrstuvwxyz_0_0.pdf

In this case, the attachment file name will be:

123_4567890abcdefghijklmnopqrstuvwxyz_0_0.pdf

reference: (182987737)

VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 3.3/10 (12 votes cast)