These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

open a non pdf file using javascript

Tim Klahr
Registered: Feb 7 2011
Posts: 12

I want to have a button that opens a ics file (calendar file) using javascript, because the name of the file will change depending on other fields. I get a NotAllowedError saying security settings prevent access to th is property or method when attemping to open a file that is not a pdf. I've even added a trusted function to my config.js to see if that would allow me to do it, and it gives me the same error. Do any of you have a solution for this issue?
 
This is what I am using:
 
app.openDoc("/C/TEMP/testing.ics")
 
Thanks!

My Product Information:
Acrobat Pro 9.0, Windows
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
A 'temp' directory is not considered a safe path by Adobe.

George Kaiser

UVSAR
Expert
Registered: Oct 29 2008
Posts: 1357
You can't - openDoc only works on PDF files as there's no concept of "opening" anything OTHER than a PDF file in Acrobat.

You're also forbidden from opening files on a local file system from a document-level script, for obvious reasons. If the ICS file is an *attachment* you could open it as a raw stream of data using the util.readFileIntoStream() function but only in Acrobat X.
Tim Klahr
Registered: Feb 7 2011
Posts: 12
thanks for your responses. Is there any way to tell acrobat to open a specific file using javascript? Using the execute menu item it is possible to open an ICS file, it's just that the ICS file will not always be the same name.
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
No. If you manually open an MS Word file with Acrobat, the Word file gets converted to a PDF.

Exactly what are you trying to accomplish?




George Kaiser