NumeralFormat

Inheritance: java.lang.Object

public class NumeralFormat

Indicates the symbol set that is used to represent numbers while rendering to fixed page formats.

Examples:

Shows how to set the numeral format used when saving to PDF.


 Document doc = new Document();
 DocumentBuilder builder = new DocumentBuilder(doc);

 builder.getFont().setLocaleId(1025);
 builder.writeln("1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 50, 100");

 // Create a "PdfSaveOptions" object that we can pass to the document's "Save" method
 // to modify how that method converts the document to .PDF.
 PdfSaveOptions options = new PdfSaveOptions();

 // Set the "NumeralFormat" property to "NumeralFormat.ArabicIndic" to
 // use glyphs from the U+0660 to U+0669 range as numbers.
 // Set the "NumeralFormat" property to "NumeralFormat.Context" to
 // look up the locale to determine what number of glyphs to use.
 // Set the "NumeralFormat" property to "NumeralFormat.EasternArabicIndic" to
 // use glyphs from the U+06F0 to U+06F9 range as numbers.
 // Set the "NumeralFormat" property to "NumeralFormat.European" to use european numerals.
 // Set the "NumeralFormat" property to "NumeralFormat.System" to determine the symbol set from regional settings.
 options.setNumeralFormat(numeralFormat);

 doc.save(getArtifactsDir() + "PdfSaveOptions.SetNumeralFormat.pdf", options);
 

Fields

FieldDescription
ARABIC_INDICNumerals used in Arabic: \u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669.
CONTEXTSymbol set is decided from context(locale and RTL property).
EASTERN_ARABIC_INDICNumerals used in Persian and Urdu: \u06f0\u06f1\u06f2\u06f3\u06f4\u06f5\u06f6\u06f7\u06f8\u06f9.
EUROPEANEuropean numerals: 0123456789.
SYSTEMTHIS OPTION IS NOT SUPPORTED.
length

Methods

MethodDescription
fromName(String numeralFormatName)
getName(int numeralFormat)
getValues()
toString(int numeralFormat)

ARABIC_INDIC

public static int ARABIC_INDIC

Numerals used in Arabic: \u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669. Unicode range U+0660 - u+0669.

CONTEXT

public static int CONTEXT

Symbol set is decided from context(locale and RTL property).

EASTERN_ARABIC_INDIC

public static int EASTERN_ARABIC_INDIC

Numerals used in Persian and Urdu: \u06f0\u06f1\u06f2\u06f3\u06f4\u06f5\u06f6\u06f7\u06f8\u06f9. Unicode range U+06F0 - u+06F9.

EUROPEAN

public static int EUROPEAN

European numerals: 0123456789.

SYSTEM

public static int SYSTEM

THIS OPTION IS NOT SUPPORTED. Symbol set is decided from regional settings.

length

public static int length

fromName(String numeralFormatName)

public static int fromName(String numeralFormatName)

Parameters:

ParameterTypeDescription
numeralFormatNamejava.lang.String

Returns: int

getName(int numeralFormat)

public static String getName(int numeralFormat)

Parameters:

ParameterTypeDescription
numeralFormatint

Returns: java.lang.String

getValues()

public static int[] getValues()

Returns: int[]

toString(int numeralFormat)

public static String toString(int numeralFormat)

Parameters:

ParameterTypeDescription
numeralFormatint

Returns: java.lang.String