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

app.openDoc() with bUseConv=true fails to open non-PDF files in Reader

jbaker
Registered: Feb 20 2009
Posts: 2
Answered

Hello,

I’m executing the following JavaScript in Reader 9.0. I’m doing this by placing the script (test.js) in the C:\Program Files\Adobe\Reader 9.0\Reader\Javascripts and launching Reader. FYI, I’ve also created a config.js in this same folder with the myTrustedOpenDoc function definition in it (bUseConv requires privileged context).

test.js:
var newDoc = myTrustedOpenDoc({
cPath: "/C/temp/acrobat/4519-31968.txt",
bUseConv: true
})

config.js:
myTrustedOpenDoc = app.trustedFunction( function ( oArgs )
{
app.beginPriv();
var myTrustedRetn = app.openDoc( oArgs );
app.endPriv();
return myTrustedRetn;
});

When I launch Reader, the script executes and I get the error “Adobe Reader could not open ‘4519-31968.txt’ because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn’t correctly decoded).”.

The same result occurs if I try a .doc or .htm file. The only file type that works is .pdf.

I do not get the error and the .txt, .doc, and .htm files open just fine with Acrobat Professional 9.0. I’m getting the impression Reader doesn’t support the bUseConv option. The JavaScript API Reference says the openDoc() function is supported on all platforms (Reader, Standard, and Professional) and there isn’t a documented exception for the bUseConv parameter.

So, am I doing something wrong or is the documentation wrong?

Thank you for your help,
Jenn

My Product Information:
Reader 9.0, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
I suppose you could say the documentation is incomplete. Reader simply doesn't have that functionality. It's a tool for working with existing PDF documents.

George