I was wondering, is it a lot of work to add a "getColor" function to the color-class ?
On i-series it's "impossible" to retrieve class-fields, so I can't use the pre-defined colors. If you provide a function that returns a color-object for a specified "color-name" this would be a great help !
received Java exception "java.lang.NumberFormatException: For input string: "Red"" when calling method "" with signature "(Ljava.lang.String;)V" in class "com.aspose.pdf.elements.RgbColorSpace".
Sorry I don’t know you are using Java version. In Java version only the names listed at Color | Aspose.PDF for Java API Reference are supported. You can use them like the following:
text1.getTextInfo().setTextColor(Color.Red);
Btw, you can refer to the ColorExample.java and ColorSpaceExample.java in the examples of Aspose.Pdf for Java.
I tested text1.getTextInfo().setTextColor(Color.Red); and no error is found. If you still can’t use Red color please provide your code that can reproduce this error.
I know this works, but as I mentioned at the beginning of this topic "I can't use class fields on iseries" !
In your example you use Color.red, where red is a field of class "Color".
I'm looking for a function that returns a color-object for a given color-name. I thought the rgbColorspace constructor would solve my problem, but I get an error (see previous messages).
Something like Color RedColor = getColor("Red") would help me a lot.