Skip to main content
JR Boulay
Community Expert
Community Expert
March 24, 2017
Question

exportDataObject & Attach File comment tool

  • March 24, 2017
  • 3 replies
  • 2324 views

Hi experts.

I know how to use

this.exportDataObject({cName: "myFile.pdf", nLaunch: 2});

to open an attachment.

It works fine with attachments attached using the Attachments pane, but when I want to open an attachment attached using the Attach File comment tool I always get this error mesage: TypeError: Invalid argument type.

What must I do to JavaScript-open an attachment attached using the Attach File comment tool?

I need this to works with Acrobat Reader (11 & DC).

Thank You

This topic has been closed for replies.

3 replies

JR Boulay
Community Expert
JR BoulayCommunity ExpertAuthor
Community Expert
March 25, 2017

I found a workaround.

Instead of displaying a button for opening each attachment, I'd placed the attachment icon instead.

So users can double-clic the icon for opening attachments.

It was a challenge to set the precise position for each icon, but it's OK now.

Acrobate du PDF, InDesigner et Photoshopographe
Participant
July 11, 2022

Hola JR Boulay, ¿podrías compartir tu archivo PDF?. Intento hacer un formulario igual al tuyo pero me estoy volviendo loco con el código y no consigo que funcione. ¿Serías tan amable?. Gracias de antemano. javero25@gmail.com

Joel Geraci
Community Expert
Community Expert
March 24, 2017

It's not the JavaScript method, it's the Acrobat UI. The UI will, as a convenience, show page level attachments in the same pane as document level attachments. They aren't stored in the PDF in the same way though.

try67
Community Expert
Community Expert
March 24, 2017

AFAIK, it's not possible to do that.

JR Boulay
Community Expert
JR BoulayCommunity ExpertAuthor
Community Expert
March 24, 2017

If ever a bomb exploded at the guy who (not) implemented this JavaScript method in PDF format I would make a good suspect ...

Thank you try67.

Acrobate du PDF, InDesigner et Photoshopographe
Joel Geraci
Community Expert
Community Expert
March 24, 2017

JR:

You do understand that the fact that you used the words "bomb" and "exploded" in this forum means that we're now all going to have to uninstall Acrobat from our laptops before boarding a flight. Thanks... really.