CssStyleParser
Overview
CssStyleParser is a class in Aspose.PDF FOSS for Java.
Parses inline CSS style strings and applies them to a {@link CssContext}.
This class provides 6 methods for working with CssStyleParser objects in Java programs.
Available methods include: applyInlineStyle, isBold, parseColor, parseDimension, parseFont, parseMarginShorthand.
All public members are accessible to any Java application after installing the Aspose.PDF FOSS for Java package.
Methods
| Signature | Description |
|---|---|
applyInlineStyle(ctx: CssContext, styleStr: String) | Parses an inline CSS style string and applies recognized properties |
| to the given context. | |
parseDimension(value: String, base: double) → double | Parses a CSS dimension value and converts it to PDF points (1pt = 1/72 in). |
parseColor(value: String) → Color | Parses a CSS color value and returns a {@link Color}. |
parseFont(value: String) → String | Extracts the first font name from a CSS font-family value. |
isBold(value: String) → boolean | Determines whether a CSS font-weight value represents bold. |
parseMarginShorthand(ctx: CssContext, value: String) | Parses a CSS margin shorthand value and applies it to the context. |