1

I passed my pdf-generator project from lowagie-4.2.0_17 to itextpdf-5.5.6

In my project I have

Color.decode(colorString)

I replace it by

HtmlUtilities.decodeColor(colorString)

but it is Deprecated

What alternativ exists for HtmlUtilities.decodeColor() ?

thanks

Valeriane
  • 936
  • 3
  • 16
  • 37

1 Answers1

0

I think there is a misunderstanding.

It is not our intention to deprecate HtmlUtilities.decodeColor(). That method is used throughout iText and XML Worker. However, HtmlUtilities.decodeColor() still uses the deprecated WebColors class:

public static BaseColor decodeColor(String s) {
    if (s == null)
        return null;
    s = s.toLowerCase().trim();
    try {
        return WebColors.getRGBColor(s);
    }
    catch(IllegalArgumentException iae) {
        return null;
    }
}

The class WebColors is deprecated. At some point in time, the content of the method WebColors.getRGBColor() will be moved into HtmlUtilities and the class WebColors will disappear.

I'm not sure how you detected that HtmlUtilities.decodeColor() is deprecated. It uses a deprecated class (for now), but the method itself isn't deprecated.

Bruno Lowagie
  • 75,994
  • 9
  • 109
  • 165