Class PDNumberFormatDictionary
java.lang.Object
org.apache.pdfbox.pdmodel.interactive.measurement.PDNumberFormatDictionary
- All Implemented Interfaces:
COSObjectable
This class represents a number format dictionary.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Constant for showing a fractional value as decimal to the precision specified by the D entry.static final String
Constant for showing a fractional value as a fraction with denominator specified by the D entry.static final String
Constant for showing a fractional value without fractional part; round to the nearest whole unit.static final String
Constant for showing a fractional value without fractional part; truncate to achieve whole units.static final String
Constant indicating that the label specified by U is a postfix to the value.static final String
Constant indicating that the label specified by U is a suffix to the value.static final String
The type of the dictionary. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.PDNumberFormatDictionary
(COSDictionary dictionary) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfloat
This will return the conversion factor.This will return the dictionary.This will return the text to be used as the decimal point in displaying numerical values.int
This will return the precision or denominator of a fractional amount.This will return the value for the manner to display a fractional value.This will return a value indicating the ordering of the label specified by U to the calculated unit value.This will return the text to be concatenated to the left of the label specified by U.This will return the text to be concatenated after the label specified by U.This will return the text to be used between orders of thousands in display of numerical values.getType()
This will return the type of the number format dictionary.getUnits()
This will return the label for the units.boolean
isFD()
This will return the value indication if the denominator of the fractional value is reduced/truncated .void
setConversionFactor
(float conversionFactor) This will set the conversion factor.void
setDecimalSeparator
(String decimalSeparator) This will set the text to be used as the decimal point in displaying numerical values.void
setDenominator
(int denominator) This will set the precision or denominator of a fractional amount.void
setFD
(boolean fd) This will set the value indication if the denominator of the fractional value is reduced/truncated .void
setFractionalDisplay
(String fractionalDisplay) This will set the value for the manner to display a fractional value.void
setLabelPositionToValue
(String labelPositionToValue) This will set the value indicating the ordering of the label specified by U to the calculated unit value.void
setLabelPrefixString
(String labelPrefixString) This will set the text to be concatenated to the left of the label specified by U.void
setLabelSuffixString
(String labelSuffixString) This will set the text to be concatenated after the label specified by U.void
setThousandsSeparator
(String thousandsSeparator) This will set the text to be used between orders of thousands in display of numerical values.void
This will set the label for the units.
-
Field Details
-
TYPE
The type of the dictionary.- See Also:
-
LABEL_SUFFIX_TO_VALUE
Constant indicating that the label specified by U is a suffix to the value.- See Also:
-
LABEL_PREFIX_TO_VALUE
Constant indicating that the label specified by U is a postfix to the value.- See Also:
-
FRACTIONAL_DISPLAY_DECIMAL
Constant for showing a fractional value as decimal to the precision specified by the D entry.- See Also:
-
FRACTIONAL_DISPLAY_FRACTION
Constant for showing a fractional value as a fraction with denominator specified by the D entry.- See Also:
-
FRACTIONAL_DISPLAY_ROUND
Constant for showing a fractional value without fractional part; round to the nearest whole unit.- See Also:
-
FRACTIONAL_DISPLAY_TRUNCATE
Constant for showing a fractional value without fractional part; truncate to achieve whole units.- See Also:
-
-
Constructor Details
-
PDNumberFormatDictionary
public PDNumberFormatDictionary()Constructor. -
PDNumberFormatDictionary
Constructor.- Parameters:
dictionary
- the corresponding dictionary
-
-
Method Details
-
getCOSObject
This will return the dictionary.- Specified by:
getCOSObject
in interfaceCOSObjectable
- Returns:
- the number format dictionary
-
getType
This will return the type of the number format dictionary. It must be "NumberFormat"- Returns:
- the type
-
getUnits
This will return the label for the units.- Returns:
- the label for the units
-
setUnits
This will set the label for the units.- Parameters:
units
- the label for the units
-
getConversionFactor
public float getConversionFactor()This will return the conversion factor.- Returns:
- the conversion factor
-
setConversionFactor
public void setConversionFactor(float conversionFactor) This will set the conversion factor.- Parameters:
conversionFactor
- the conversion factor
-
getFractionalDisplay
This will return the value for the manner to display a fractional value.- Returns:
- the manner to display a fractional value
-
setFractionalDisplay
This will set the value for the manner to display a fractional value. Allowed values are "D", "F", "R", "T" and null.- Parameters:
fractionalDisplay
- the manner to display a fractional value
-
getDenominator
public int getDenominator()This will return the precision or denominator of a fractional amount.- Returns:
- the precision or denominator
-
setDenominator
public void setDenominator(int denominator) This will set the precision or denominator of a fractional amount.- Parameters:
denominator
- the precision or denominator
-
isFD
public boolean isFD()This will return the value indication if the denominator of the fractional value is reduced/truncated .- Returns:
- fd
-
setFD
public void setFD(boolean fd) This will set the value indication if the denominator of the fractional value is reduced/truncated . The denominator may not be reduced/truncated if true- Parameters:
fd
- fd
-
getThousandsSeparator
This will return the text to be used between orders of thousands in display of numerical values.- Returns:
- thousands separator
-
setThousandsSeparator
This will set the text to be used between orders of thousands in display of numerical values.- Parameters:
thousandsSeparator
- thousands separator
-
getDecimalSeparator
This will return the text to be used as the decimal point in displaying numerical values.- Returns:
- decimal separator
-
setDecimalSeparator
This will set the text to be used as the decimal point in displaying numerical values.- Parameters:
decimalSeparator
- decimal separator
-
getLabelPrefixString
This will return the text to be concatenated to the left of the label specified by U.- Returns:
- label prefix
-
setLabelPrefixString
This will set the text to be concatenated to the left of the label specified by U.- Parameters:
labelPrefixString
- label prefix
-
getLabelSuffixString
This will return the text to be concatenated after the label specified by U.- Returns:
- label suffix
-
setLabelSuffixString
This will set the text to be concatenated after the label specified by U.- Parameters:
labelSuffixString
- label suffix
-
getLabelPositionToValue
This will return a value indicating the ordering of the label specified by U to the calculated unit value.- Returns:
- label position
-
setLabelPositionToValue
This will set the value indicating the ordering of the label specified by U to the calculated unit value. Possible values are "S", "P" and null.- Parameters:
labelPositionToValue
- label position
-