Class BillFormat
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final double
Default width for left and right margin, in mm. -
Constructor Summary
ConstructorDescriptionCreates a new instance with default valuesBillFormat
(BillFormat format) Copy constructor: creates a copy of the specified format -
Method Summary
Modifier and TypeMethodDescriptionboolean
Gets the font family to be used for textGets the graphics format for the generated QR billGets the bill language.Gets the local country code.double
Gets the left margin width (from edge of paper to start of text).double
Gets the right margin width (from the end of the text to the edge of the paper).Gets the output size for the generated QR billint
Gets the resolution for pixel graphics formats.Gets the type of separator drawn above and between the payment part and the receiptint
hashCode()
void
setFontFamily
(String fontFamily) Sets the font family to be used for textvoid
setGraphicsFormat
(GraphicsFormat graphicsFormat) Sets the graphics format for the generated QR billvoid
setLanguage
(Language language) Sets the bill languagevoid
setLocalCountryCode
(String localCountryCode) Sets the local country code.void
setMarginLeft
(double marginLeft) Sets the left margin width (from edge of paper to start of text).void
setMarginRight
(double marginRight) Gets the right margin width (from the end of the text to the edge of the paper).void
setOutputSize
(OutputSize outputSize) Sets the output size for the generated QR billvoid
setResolution
(int resolution) Sets the resolution for pixel graphics formats.void
setSeparatorType
(SeparatorType separatorType) Sets the type of separator drawn above and between the payment part and the receipttoString()
-
Field Details
-
DEFAULT_MARGIN_WIDTH
public static final double DEFAULT_MARGIN_WIDTHDefault width for left and right margin, in mm.- See Also:
-
-
Constructor Details
-
BillFormat
public BillFormat()Creates a new instance with default values -
BillFormat
Copy constructor: creates a copy of the specified format- Parameters:
format
- format to copy
-
-
Method Details
-
getOutputSize
Gets the output size for the generated QR billDefaults to
OutputSize.QR_BILL_ONLY
, i.e. the QR bill only (about 105 by 210 mm)- Returns:
- output size
- See Also:
-
setOutputSize
Sets the output size for the generated QR bill- Parameters:
outputSize
- output size- See Also:
-
getLanguage
Gets the bill language.Defaults to EN (English).
- Returns:
- the language
-
setLanguage
Sets the bill language- Parameters:
language
- the language
-
getSeparatorType
Gets the type of separator drawn above and between the payment part and the receiptDefaults to
SeparatorType.DASHED_LINE_WITH_SCISSORS
- Returns:
- separator type
-
setSeparatorType
Sets the type of separator drawn above and between the payment part and the receipt- Parameters:
separatorType
- separator type
-
getFontFamily
Gets the font family to be used for textAccording to the implementation guidelines Arial, Frutiger, Helvetica and Liberation Sans are the only permitted fonts.
Two styles of the font are used: normal/regular and bold.
Defaults to "Helvetica".
- Returns:
- font family name
-
setFontFamily
Sets the font family to be used for textAccording to the implementation guidelines Arial, Frutiger, Helvetica and Liberation Sans are the only permitted fonts. However, any string is accepted as the font name might be more elaborate such as "Frutiger 55 Regular".
Two styles of the font are used: normal/regular and bold.
Defaults to "Helvetica".
- Parameters:
fontFamily
- font family name
-
getGraphicsFormat
Gets the graphics format for the generated QR billDefaults to SVG.
- Returns:
- graphics format
-
setGraphicsFormat
Sets the graphics format for the generated QR bill- Parameters:
graphicsFormat
- graphics format
-
getResolution
public int getResolution()Gets the resolution for pixel graphics formats.Defaults to 144 dpi.
- Returns:
- graphics resolution, in dpi
-
setResolution
public void setResolution(int resolution) Sets the resolution for pixel graphics formats.- Parameters:
resolution
- graphics resolution, in dpi
-
getMarginLeft
public double getMarginLeft()Gets the left margin width (from edge of paper to start of text).Valid values are between 5mm and 12mm. The default is 5mm.
Values other than 5mm are not fully standard compliant as the fields in the receipt on the left-hand side become narrower. It is especially obvious if Payable by or Amount are not pre-filled so that the black corners are printed instead of text. Yet values higher than 5mm are more compatible with typical office and home printers, which are not capable of printing up to the edge of the paper and require a margin wider than 5mm.
- Returns:
- margin width, in mm
-
setMarginLeft
public void setMarginLeft(double marginLeft) Sets the left margin width (from edge of paper to start of text).Valid values are between 5mm and 12mm. The default is 5mm.
Values other than 5mm are not fully standard compliant as the fields in the receipt on the left-hand side become narrower. It is especially obvious if Payable by or Amount are not pre-filled so that the black corners are printed instead of text. Yet values higher than 5mm are more compatible with typical office and home printers, which are not capable of printing up to the edge of the paper and require a margin wider than 5mm.
- Parameters:
marginLeft
- margin width, in mm
-
getMarginRight
public double getMarginRight()Gets the right margin width (from the end of the text to the edge of the paper).Valid values are between 5mm and 12mm. The default is 5m.
Values other than 5mm are not fully standard compliant but are more compatible with typical office and home printers, which are not capable of printing up to the edge of the paper and require a margin wider than 5mm.
- Returns:
- width, in mm
-
setMarginRight
public void setMarginRight(double marginRight) Gets the right margin width (from the end of the text to the edge of the paper).Valid values are between 5mm and 12mm. The default is 5m.
Values other than 5mm are not fully standard compliant but are more compatible with typical office and home printers, which are not capable of printing up to the edge of the paper and require a margin wider than 5mm.
- Parameters:
marginRight
- margin width, in mm
-
getLocalCountryCode
Gets the local country code.For postal addresses of this country, the country code is omitted. For all other countries, the country is prepended to the postal code and town.
Defaults to "CH".
- Returns:
- country code (ISO 3166, two uppercase letters).
-
setLocalCountryCode
Sets the local country code.For postal addresses of this country, the country code is omitted. For all other countries, the country is prepended to the postal code and town.
Defaults to "CH".
- Parameters:
localCountryCode
- country code (ISO 3166, two uppercase letters).
-
equals
-
hashCode
public int hashCode() -
toString
-