Skip to main content
October 5, 2016
Question

GetJSObject throws Value does not fall within the expected range

  • October 5, 2016
  • 3 replies
  • 1274 views

Hi,

i am facing the issue "Value does not fall within expected range" with GetJSObject using c#

facing issue at below LOC

object oColor = jsObj.color.blue();

Any help would be greatly appreciated

Thanks

This topic has been closed for replies.

3 replies

Legend
October 6, 2016

When you try something and it still doesn't work, please post the code and copy/paste the error message from the JavaScript console. We can't know what you are trying. Certainly, there are problems passing particular types of parameter which nobody has ever posted a solution to, but we can't know what applies to you if you don't show your workings out...

Karl Heinz  Kremer
Community Expert
Community Expert
October 5, 2016

As was already mentioned, blue is not a method, it's a property. The type of a color is not an object - it's a Variant()  with a number of elements. The first element is always the name, followed by one or more Double values for grayscale/RGB/CMYK values.

October 6, 2016

i tired it as variant also, and as i already mentioned the same issues occurs with addWatermarkFromFile() and AddAnnot

Legend
October 5, 2016

Is color.blue a function? I'd expect it to be a property.

October 5, 2016

Hi,

FYI, even as a property it gives the same error

Thanks

October 5, 2016

The same is likely to appear for

jsObj.addWatermarkFromFile(..parametrs)