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

Acrobat 9 crashes on running "saveAs" JS command

dominicpp
Registered: Jul 1 2010
Posts: 3

We are using JS to write a batch sequence for converting PDF to HTML. The script in fact is very simple, using mainly "saveAs". All other codes are for console display + catching exception.

/* Convert file in folder to HTML */
console.show(); console.clear();
try{
   console.println("Converting PDF "+this.documentFileName+" .....");
   this.saveAs({
     cPath: "/c/pdf2html/"+ this.documentFileName + ".php",
     cConvID: "com.adobe.acrobat.php-3-20"
   });
 
  console.println("permStatusReady:"+this.permStatusReady);
 
   this.closeDoc(true);
   console.println("Conversion completed");
} catch(e) {
   for (var i in e)
   console.println( i + ": " + e[i])
}
console.println("End");

It works fine on non-protected PDFs, but protected PDFs crash the whole Acrobat.

We accept the fact that we can’t make conversion on certain protected, encrypted file. But how can we catch the exception to avoid crashing the application?

We contacted Acrobat Support but seems it's a waste of time so far.

Any idea?

My Product Information:
Acrobat Pro Extended 9.3.1, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Protected in what way? Do they have a password? Some other security?

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

dominicpp
Registered: Jul 1 2010
Posts: 3
The incoming files are from various sources with various security settings. Some PDFs are not protected, but some are password protected. We of course are not provided with password. Contents could be encrypted and document restrictions like changing the document, content copying, document assembly ..etc are set to "Not Allowed".

We do respect these security settings. And it is fair that the saveAs command will fail upon applying on those protected documents. But instead of crashing the application, at least it should return an exception so that we can simply skip those documents and proceed to the next one, right?

Btw, here is the URL of one of the PDFs causing crash:
http://www.pccwglobal.com/images/stories/brochures/PCCW_Global_Infrastructure_Map.pdf