Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Jun 01, 2016 Jun 01, 2016

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;

}

TOPICS
Acrobat SDK and JavaScript
598
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jun 01, 2016 Jun 01, 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??

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 01, 2016 Jun 01, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 01, 2016 Jun 01, 2016
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines