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?
- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com