Skip to main content
Participant
June 1, 2016
Question

C# call Javascript at folder level and get "value does not fall within the expected range"

  • June 1, 2016
  • 1 reply
  • 696 views

I want to convert PDF to postscript. After doing some research, I wrote the following code but got the exception mentioned in title.

AcroPDDoc acroPDDoc = new AcroPDDoc();

var rc3 = acroPDDoc.Open(source);

var jso = acroPDDoc.GetJSObject();

var what = jso.PDF2PS();

acroPDDoc.Close();

Javascript in c:\program files (x86)\adobe\adobat 2015\acrobat\Javascripts. I commented the real code and only returned a value but still got the above exception.  Please help. I am in a rush to deliver this piece of code. Thank you very much. J

function PDF2PS()

{

  //var pp = this.getPrintParams();

  //pp.fileName = filename;

  //pp.printerName = "";

  //this.print(pp);

return 12345;

}

This topic has been closed for replies.

1 reply

lrosenth
Adobe Employee
Adobe Employee
June 1, 2016

Why would you do this instead of using the saveAs() method?

Have you consulted the documentation or are you tyring to do this entirely from sample code online??

jjcpaAuthor
Participant
June 1, 2016

I googled a lot and read some Adobe document about Javascript, API, SDK. I tried to this too but failed

function PDF2PS()

{

  this.saveAs("/C/Test/_bbbb.ps","com.adobe.acrobat.ps");

}

The exception happened when C# code call Javascript.

Bernd Alheit
Community Expert
Community Expert
June 1, 2016

What happens when you use File> Save As... in Acrobat?