Skip to main content
Oct 5, 2016 8:48 AM UTC
Question

GetJSObject throws Value does not fall within the expected range

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 is closed to new replies. Start a new post to keep the conversation going.

6 replies

Legend
Oct 6, 2016 8:01 AM UTC

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...

Translate
Karl Heinz  Kremer
Community Expert
Community Expert
Oct 5, 2016 6:43 PM UTC

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.

Translate
Oct 6, 2016 7:17 AM UTC

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

Translate
Legend
Oct 5, 2016 11:17 AM UTC

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

Translate
Oct 5, 2016 11:40 AM UTC

Hi,

FYI, even as a property it gives the same error

Thanks

Translate
Oct 5, 2016 12:39 PM UTC

The same is likely to appear for

jsObj.addWatermarkFromFile(..parametrs)

Translate