Posts tagged "attachment"

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)

LiveCycle ES: com.adobe.idp.DocumentError using the UserPlus QPAC with attachments

Issue

The following error occurs at run-time when you use the UserPlus QPAC from Avoka with attachments in Adobe LiveCycle ES 8.2.1:

javax.ejb.EJBException: EJB Exception: : com.adobe.idp.DocumentError: The document pointing to the file 
"/mydomain/AdobeDocumentStorage/session_wfattach443760/6261454814295665168" has expired. Consider increasing 
the document disposal timeout.
 at com.adobe.idp.DocumentFileBackend.checkFileExistance(DocumentFileBackend.java:412)
 at com.adobe.idp.DocumentFileBackend.copy(DocumentFileBackend.java:419)
 at com.adobe.idp.Document.passivate(Document.java:1065)
 at com.adobe.idp.Document.passivate(Document.java:1012)
 at com.adobe.idp.Document.<init>(Document.java:565)
 at com.adobe.idp.Document.<init>(Document.java:621)
 at com.adobe.idp.DocumentStorage.persist(DocumentStorage.java:78)
 at com.adobe.idp.taskmanager.dsc.client.task.AttachmentInfoImpl.persistDoc(AttachmentInfoImpl.java:201)
 at com.adobe.idp.taskmanager.dsc.service.CopyAttachments.copyAttachmentsToTask(CopyAttachments.java:326)
 at com.adobe.idp.taskmanager.dsc.service.CopyAttachments.copyAttachmentsForward(CopyAttachments.java:291)
 at com.adobe.idp.taskmanager.dsc.service.TaskManagerServiceImpl.createTask(TaskManagerServiceImpl.java:465)
 at sun.reflect.GeneratedMethodAccessor1243.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)

Reason

Attachments are stored in the Adobe DocumentStorage directory for LiveCycle 7 and in the GDS directory for LiveCycle 8. An error occurs in LiveCycle 8 if the attachments are stored in the DocumentStorage directory, and are not available in the GDS directory.  This can occur if you have upgraded your server from LiveCycle 7 to LiveCycle ES.

Solution

Manually copy the documents from the LiveCycle 7 DocumentStorage directory to the LiveCycle ES GDS directory.

reference: (181472965)

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

Acrobat/Reader: how to display the attachment panel automatically in XFA forms

Issue

The attachment panel in Acrobat/Reader does not appear automatically, even when the document does actually contain attachments. It is a common requirement to have the attachment panel show up automatically when opening a form which contains attachments.

Solution

Use the following instructions to check for attachments in the document, and if attachments exist, then show the attachment panel.

1. you will need to edit the form in LiveCycle Designer.

2. add a Button object to the form from the standard library.

3. set the presence of the Button to “Invisible” in the Field properties of the Object Palette (on the right-hand side).

4. goto the click event of the button at the top and enter the following client-side Javascript:

var myDoc = event.target;
var d = myDoc.dataObjects;
if ( d == null ) {
// do nothing
} else {
app.execMenuItem("ShowHideFileAttachment");
}

5. then open the doc::Ready event of the form itself and enter the following client-side Javascript to call the click event of the button when opening the form:

Form.Subform.Button1.execEvent("click");

6. save the form

Note: This solution will work for Acrobat 8. If you wish to use Reader 8, then the solution above will only work if you enable the form with ReaderExtensions server.

Note: To use this solution in Acrobat/Reader 7, then you will need to change the “ShowHideFileAttachment” key to “ShowHideAttachments".

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