Class NumberFormatDictionary
java.lang.Object
com.itextpdf.text.pdf.PdfObject
com.itextpdf.text.pdf.PdfDictionary
com.itextpdf.text.pdf.spatial.objects.NumberFormatDictionary
- All Implemented Interfaces:
Serializable
A dictionary that represents a specific unit of measurement (such as miles or feet).
It contains information about how each unit shall be expressed in text and factors
for calculating the number of units.
- Since:
- 5.1.0
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Text that shall be used between orders of thousands in display of numerical values.void
The conversion factor used to multiply a value in partial units of the previous number format array element to obtain a value in the units of this dictionary.void
Text that shall be used as the decimal position in displaying numerical values.void
setFixedDenominator
(PdfBoolean isFixedDenominator) If true, a fractional value formatted according to Precision may not have its denominator reduced or low-order zeros truncated.void
Indicate whether and in what manner to display a fractional value from the result of converting to the units of this NumberFormat means of the conversion factor entry.void
A text string specifying a label for displaying the units represented by this NumberFormat in a user interface; the label should use a universally recognized abbreviation.void
Text that shall be concatenated to the left of the label specified by setLabel.void
setLabelPosition
(PdfName pos) A name indicating the position of the label specified by setLabel with respect to the calculated unit value.void
Text that shall be concatenated after the label specified by setLabel.void
setPrecision
(PdfNumber precision) A positive integer that shall specify the precision or denominator of a fractional amount: When the Fractional Value isFraction.DECIMAL
, this entry shall be the precision of a decimal display; it shall be a multiple of 10.Methods inherited from class com.itextpdf.text.pdf.PdfDictionary
checkType, clear, contains, get, getAsArray, getAsBoolean, getAsDict, getAsIndirectObject, getAsName, getAsNumber, getAsStream, getAsString, getDirectObject, getKeys, isCatalog, isFont, isOutlineTree, isPage, isPages, merge, mergeDifferent, put, putAll, putEx, remove, size, toPdf, toString
Methods inherited from class com.itextpdf.text.pdf.PdfObject
canBeInObjStm, getBytes, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, length, setContent, setIndRef, type
-
Constructor Details
-
NumberFormatDictionary
public NumberFormatDictionary()Creates a new NumberFormat dictionary.
-
-
Method Details
-
setLabel
A text string specifying a label for displaying the units represented by this NumberFormat in a user interface; the label should use a universally recognized abbreviation.- Parameters:
label
-
-
setConversionFactor
The conversion factor used to multiply a value in partial units of the previous number format array element to obtain a value in the units of this dictionary. When this entry is in the first number format in the array, its meaning (that is, what it shall be multiplied by) depends on which entry in the RectilinearMeasure references the NumberFormat array.- Parameters:
n
-
-
setFractionalValue
Indicate whether and in what manner to display a fractional value from the result of converting to the units of this NumberFormat means of the conversion factor entry.- Parameters:
f
-
-
setPrecision
A positive integer that shall specify the precision or denominator of a fractional amount:-
When the Fractional Value is
Fraction.DECIMAL
, this entry shall be the precision of a decimal display; it shall be a multiple of 10. Low-order zeros may be truncated unless FixedDenominator is true. Default value: 100 (hundredths, corresponding to two decimal digits). - When the value of F is
Fraction.FRACTION
, this entry shall be the denominator of a fractional display. The fraction may be reduced unless the value of FD is true. Default value: 16.
- Parameters:
precision
-
-
When the Fractional Value is
-
setFixedDenominator
If true, a fractional value formatted according to Precision may not have its denominator reduced or low-order zeros truncated.- Parameters:
isFixedDenominator
-
-
setCipherGroupingCharacter
Text that shall be used between orders of thousands in display of numerical values. An empty string indicates that no text shall be added.
Default value: COMMA ","- Parameters:
rt
-
-
setDecimalChartacter
Text that shall be used as the decimal position in displaying numerical values. An empty string indicates that the default shall be used.
Default value: PERIOD "."- Parameters:
dc
-
-
setLabelLeftString
Text that shall be concatenated to the left of the label specified by setLabel. An empty string indicates that no text shall be added.
Default value: A single ASCII SPACE character " "- Parameters:
ps
-
-
setLabelRightString
Text that shall be concatenated after the label specified by setLabel. An empty string indicates that no text shall be added.
Default value: A single ASCII SPACE character " "- Parameters:
ss
-
-
setLabelPosition
A name indicating the position of the label specified by setLabel with respect to the calculated unit value. The characters specified by setLabelLeftString and setLabelRightString shall be concatenated before considering this entry. Default value: suffix.- Parameters:
pos
- PdfName.S or PdfName.P
-