|
iText 7 7.1.12 API
|
Utilities class for CSS operations. More...
Static Public Member Functions |
|
| static IList< IList< String > > | ExtractShorthandProperties (String str) |
| Extracts shorthand properties as list of string lists from a string, where the top level list is shorthand property and the lower level list is properties included in shorthand property. More... |
|
| static String | NormalizeCssProperty (String str) |
| Normalizes a CSS property. More... |
|
| static String | RemoveDoubleSpacesAndTrim (String str) |
| Removes double spaces and trims a string. More... |
|
| static ? int | ParseInteger (String str) |
| Parses an integer without throwing an exception if something goes wrong. More... |
|
| static ? float | ParseFloat (String str) |
| Parses a float without throwing an exception if something goes wrong. More... |
|
| static ? double | ParseDouble (String str) |
| Parses a double without throwing an exception if something goes wrong. More... |
|
| static float | ParseAngle (String angle, String defaultMetric) |
| Parses an angle with an allowed metric unit (deg, grad, rad) or numeric value (e.g. 123, 1.23, .123) to rad. More... |
|
| static float | ParseAngle (String angle) |
| Parses a angle with an allowed metric unit (deg, grad, rad) or numeric value (e.g. 123, 1.23, .123) to rad. More... |
|
| static int[] | ParseAspectRatio (String str) |
| Parses an aspect ratio into an array with two integers. More... |
|
| static float | ParseAbsoluteLength (String length, String defaultMetric) |
| Parses a length with an allowed metric unit (px, pt, in, cm, mm, pc, q) or numeric value (e.g. 123, 1.23, .123) to pt. A numeric value (without px, pt, etc in the given length string) is considered to be in the default metric that was given. More... |
|
| static float | ParseAbsoluteLength (String length) |
| Parses the absolute length. More... |
|
| static float | ParseRelativeValue (String relativeValue, float baseValue) |
| Parses an relative value based on the base value that was given, in the metric unit of the base value. (e.g. margin=10% should be based on the page width, so if an A4 is used, the margin = 0.10*595.0 = 59.5f) More... |
|
| static UnitValue | ParseLengthValueToPt (String value, float emValue, float remValue) |
| Convenience method for parsing a value to pt. More... |
|
| static float | ParseAbsoluteFontSize (String fontSizeValue, String defaultMetric) |
| Parses the absolute font size. More... |
|
| static float | ParseAbsoluteFontSize (String fontSizeValue) |
| Parses the absolute font size. More... |
|
| static float | ParseRelativeFontSize (String relativeFontSizeValue, float baseValue) |
| Parses the relative font size. More... |
|
| static UnitValue[] | ParseSpecificCornerBorderRadius (String specificBorderRadius, float emValue, float remValue) |
| Parses the border radius of specific corner. More... |
|
| static float | ParseResolution (String resolutionStr) |
| Parses the resolution. More... |
|
| static int | DeterminePositionBetweenValueAndUnit (String @string) |
| Method used in preparation of splitting a string containing a numeric value with a metric unit (e.g. 18px, 9pt, 6cm, etc). Determines the position between digits and affiliated characters ('+','-','0-9' and '.') and all other characters. e.g. string "16px" will return 2, string "0.5em" will return 3 and string '-8.5mm' will return 4. More... |
|
| static bool | IsMetricValue (String value) |
| Checks whether a string contains an allowed metric unit in HTML/CSS; px, in, cm, mm, pc, Q or pt. More... |
|
| static bool | IsAngleValue (String value) |
| Checks whether a string contains an allowed metric unit in HTML/CSS; rad, deg and grad. More... |
|
| static bool | IsRelativeValue (String value) |
| Checks whether a string contains an allowed value relative to previously set value. More... |
|
| static bool | IsFontRelativeValue (String value) |
| Checks whether a string contains an allowed value relative to font. More... |
|
| static bool | IsPercentageValue (String value) |
| Checks whether a string contains a percentage value More... |
|
| static bool | IsRemValue (String value) |
| Checks whether a string contains an allowed value relative to previously set root value. More... |
|
| static bool | IsEmValue (String value) |
| Checks whether a string contains an allowed value relative to parent value. More... |
|
| static bool | IsExValue (String value) |
| Checks whether a string contains an allowed value relative to element font height. More... |
|
| static bool | IsNumericValue (String value) |
| Checks whether a string matches a numeric value (e.g. 123, 1.23, .123). More... |
|
| static String | ExtractUrl (String url) |
Parses url("file.jpg") to file.jpg. More... |
|
| static bool | IsBase64Data (String data) |
| Checks if a data is base 64 encoded. More... |
|
| static int | FindNextUnescapedChar (String source, char ch, int startIndex) |
| Find the next unescaped character. More... |
|
| static bool | IsColorProperty (String value) |
| Checks if a value is a color property. More... |
|
| static bool | CompareFloats (double d1, double d2) |
| Helper method for comparing floating point numbers More... |
|
| static bool | CompareFloats (float f1, float f2) |
| Helper method for comparing floating point numbers More... |
|
| static float[] | ParseRgbaColor (String colorValue) |
| Parses the RGBA color. More... |
|
| static Range | ParseUnicodeRange (String unicodeRange) |
| Parses the unicode range. More... |
|
| static float | ConvertPtsToPx (float pts) |
| Convert given point value to a pixel value. More... |
|
| static double | ConvertPtsToPx (double pts) |
| Convert given point value to a pixel value. More... |
|
| static float | ConvertPxToPts (float px) |
| Convert given point value to a point value. More... |
|
| static double | ConvertPxToPts (double px) |
| Convert given point value to a point value. More... |
|
Utilities class for CSS operations.
|
inlinestatic |
Helper method for comparing floating point numbers
| d1 | first float to compare |
| d2 | second float to compare |
|
inlinestatic |
Helper method for comparing floating point numbers
| f1 | first float to compare |
| f2 | second float to compare |
|
inlinestatic |
Convert given point value to a pixel value.
Convert given point value to a pixel value. 1 px is 0.75 pts.
| pts | double value to be converted to pixels |
|
inlinestatic |
Convert given point value to a pixel value.
Convert given point value to a pixel value. 1 px is 0.75 pts.
| pts | float value to be converted to pixels |
|
inlinestatic |
Convert given point value to a point value.
Convert given point value to a point value. 1 px is 0.75 pts.
| px | double value to be converted to pixels |
|
inlinestatic |
Convert given point value to a point value.
Convert given point value to a point value. 1 px is 0.75 pts.
| px | float value to be converted to pixels |
|
inlinestatic |
Method used in preparation of splitting a string containing a numeric value with a metric unit (e.g. 18px, 9pt, 6cm, etc).
Determines the position between digits and affiliated characters ('+','-','0-9' and '.') and all other characters.
e.g. string "16px" will return 2, string "0.5em" will return 3 and string '-8.5mm' will return 4.
| string | containing a numeric value with a metric unit |
|
inlinestatic |
Extracts shorthand properties as list of string lists from a string, where the top level list is shorthand property and the lower level list is properties included in shorthand property.
| str | the source string with shorthand properties |
|
inlinestatic |
Parses url("file.jpg") to file.jpg.
| url | the url attribute to parse |
|
inlinestatic |
Find the next unescaped character.
| source | a source |
| ch | the character to look for |
| startIndex | where to start looking |
|
inlinestatic |
Checks whether a string contains an allowed metric unit in HTML/CSS; rad, deg and grad.
| value | the string that needs to be checked. |
|
inlinestatic |
Checks if a data is base 64 encoded.
| data | the data |
|
inlinestatic |
Checks if a value is a color property.
| value | the value |
|
inlinestatic |
Checks whether a string contains an allowed value relative to parent value.
| value | the string that needs to be checked. |
|
inlinestatic |
Checks whether a string contains an allowed value relative to element font height.
| value | the string that needs to be checked. |
|
inlinestatic |
Checks whether a string contains an allowed value relative to font.
| value | the string that needs to be checked. |
|
inlinestatic |
Checks whether a string contains an allowed metric unit in HTML/CSS; px, in, cm, mm, pc, Q or pt.
| value | the string that needs to be checked. |
|
inlinestatic |
Checks whether a string matches a numeric value (e.g. 123, 1.23, .123).
Checks whether a string matches a numeric value (e.g. 123, 1.23, .123). All these metric values are allowed in HTML/CSS.
| value | the string that needs to be checked. |
|
inlinestatic |
Checks whether a string contains a percentage value
| value | the string that needs to be checked |
|
inlinestatic |
Checks whether a string contains an allowed value relative to previously set value.
| value | the string that needs to be checked. |
|
inlinestatic |
Checks whether a string contains an allowed value relative to previously set root value.
| value | the string that needs to be checked. |
|
inlinestatic |
Normalizes a CSS property.
| str | the property |
|
inlinestatic |
Parses the absolute font size.
Parses the absolute font size.
A numeric value (without px, pt, etc in the given length string) is considered to be in the px.
| fontSizeValue | the font size value as a System.String |
float
|
inlinestatic |
Parses the absolute font size.
Parses the absolute font size.
A numeric value (without px, pt, etc in the given length string) is considered to be in the default metric that was given.
| fontSizeValue | the font size value as a System.String |
| defaultMetric | the string containing the metric if it is possible that the length string does not contain one. If null the length is considered to be in px as is default in HTML/CSS. |
float
|
inlinestatic |
Parses the absolute length.
| length | the length as a string |
|
inlinestatic |
Parses a length with an allowed metric unit (px, pt, in, cm, mm, pc, q) or numeric value (e.g. 123, 1.23, .123) to pt.
A numeric value (without px, pt, etc in the given length string) is considered to be in the default metric that was given.
| length | the string containing the length. |
| defaultMetric | the string containing the metric if it is possible that the length string does not contain one. If null the length is considered to be in px as is default in HTML/CSS. |
|
inlinestatic |
Parses a angle with an allowed metric unit (deg, grad, rad) or numeric value (e.g. 123, 1.23, .123) to rad.
Parses a angle with an allowed metric unit (deg, grad, rad) or numeric value (e.g. 123, 1.23, .123) to rad. Default metric is degrees
| angle | String containing the angle to parse |
|
inlinestatic |
Parses an angle with an allowed metric unit (deg, grad, rad) or numeric value (e.g. 123, 1.23, .123) to rad.
| angle | String containing the angle to parse |
| defaultMetric | default metric to use in case the input string does not specify a metric |
|
inlinestatic |
Parses an aspect ratio into an array with two integers.
| str | a string that might contain two integer values |
|
inlinestatic |
Parses a double without throwing an exception if something goes wrong.
| str | a string that might be a double value |
|
inlinestatic |
Parses a float without throwing an exception if something goes wrong.
| str | a string that might be a float value |
|
inlinestatic |
Parses an integer without throwing an exception if something goes wrong.
| str | a string that might be an integer value |
|
inlinestatic |
Convenience method for parsing a value to pt.
Convenience method for parsing a value to pt. Possible values are:
| value | the value |
| emValue | the em value |
| remValue | the root em value |
|
inlinestatic |
Parses the relative font size.
| relativeFontSizeValue | the relative font size value as a System.String |
| baseValue | the base value |
float
|
inlinestatic |
Parses an relative value based on the base value that was given, in the metric unit of the base value.
(e.g. margin=10% should be based on the page width, so if an A4 is used, the margin = 0.10*595.0 = 59.5f)
| relativeValue | in %, em or ex. |
| baseValue | the value the returned float is based on. |
|
inlinestatic |
Parses the resolution.
| resolutionStr | the resolution as a string |
|
inlinestatic |
Parses the RGBA color.
| colorValue | the color value |
|
inlinestatic |
Parses the border radius of specific corner.
| specificBorderRadius | string that defines the border radius of specific corner. |
| emValue | the em value |
| remValue | the root em value |
|
inlinestatic |
Parses the unicode range.
| unicodeRange | the string which stores the unicode range |
|
inlinestatic |
Removes double spaces and trims a string.
| str | the string |