CssContext
Overview
CssContext is a class in Aspose.Pdf FOSS for Java.
Cascading style context for HTML-to-PDF conversion.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
fontSize | double | Read | Returns the font size in points. |
fontFamily | String | Read | Returns the CSS font-family name. |
bold | boolean | Read | Returns whether the text is bold. |
italic | boolean | Read | Returns whether the text is italic. |
underline | boolean | Read | Returns whether the text is underlined. |
color | Color | Read | Returns the text (foreground) color. |
backgroundColor | Color | Read | Returns the background color, or {@code null} if none is set. |
textAlign | String | Read | Returns the text alignment (left, center, right, justify). |
lineHeight | double | Read | Returns the line height in points. |
marginTop | double | Read | Returns the top margin in points. |
marginBottom | double | Read | Returns the bottom margin in points. |
marginLeft | double | Read | Returns the left margin in points. |
marginRight | double | Read | Returns the right margin in points. |
width | double | Read | Returns the explicit width in points, or 0 if not set. |
height | double | Read | Returns the explicit height in points, or 0 if not set. |
Methods
| Signature | Description |
|---|---|
inherit() → CssContext | Creates a new child context that inherits text properties from this context. |
toPdfFontName() → String | Maps the current font-family, bold, and italic settings to a PDF standard |
| (Type 1) font name. | |
getFontSize() → double | Returns the font size in points. |
setFontSize(fontSize: double) | Sets the font size in points. |
getFontFamily() → String | Returns the CSS font-family name. |
setFontFamily(fontFamily: String) | Sets the CSS font-family name. |
isBold() → boolean | Returns whether the text is bold. |
setBold(bold: boolean) | Sets the bold flag. |
isItalic() → boolean | Returns whether the text is italic. |
setItalic(italic: boolean) | Sets the italic flag. |
isUnderline() → boolean | Returns whether the text is underlined. |
setUnderline(underline: boolean) | Sets the underline flag. |
getColor() → Color | Returns the text (foreground) color. |
setColor(color: Color) | Sets the text (foreground) color. |
getBackgroundColor() → Color | Returns the background color, or {@code null} if none is set. |
setBackgroundColor(backgroundColor: Color) | Sets the background color. |
getTextAlign() → String | Returns the text alignment (left, center, right, justify). |
setTextAlign(textAlign: String) | Sets the text alignment. |
getLineHeight() → double | Returns the line height in points. |
setLineHeight(lineHeight: double) | Sets the line height in points. |
getMarginTop() → double | Returns the top margin in points. |
setMarginTop(marginTop: double) | Sets the top margin in points. |
getMarginBottom() → double | Returns the bottom margin in points. |
setMarginBottom(marginBottom: double) | Sets the bottom margin in points. |
getMarginLeft() → double | Returns the left margin in points. |
setMarginLeft(marginLeft: double) | Sets the left margin in points. |
getMarginRight() → double | Returns the right margin in points. |
setMarginRight(marginRight: double) | Sets the right margin in points. |
getWidth() → double | Returns the explicit width in points, or 0 if not set. |
setWidth(width: double) | Sets the explicit width in points. |
getHeight() → double | Returns the explicit height in points, or 0 if not set. |
setHeight(height: double) | Sets the explicit height in points. |