Class EPSCanvasProvider
java.lang.Object
org.krysalis.barcode4j.output.AbstractCanvasProvider
org.krysalis.barcode4j.output.eps.EPSCanvasProvider
- All Implemented Interfaces:
CanvasProvider
CanvasProvider implementation for EPS output (Encapsulated PostScript).
- Version:
- $Id: EPSCanvasProvider.java,v 1.7 2009-03-12 15:04:55 jmaerki Exp $
- Author:
- Jeremias Maerki
-
Field Summary
Fields inherited from class org.krysalis.barcode4j.output.AbstractCanvasProvider
bardim -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeviceFillRect(double x, double y, double w, double h) Paints a filled rectangle.voiddeviceText(String text, double x1, double x2, double y1, String fontName, double fontSize, TextAlignment textAlign) Draws text.voidSets the dimensions of the barcode.voidfinish()Writes the EPS trailer.protected DecimalFormatReturns the DecimalFormat instance to use internally to format numbers.Methods inherited from class org.krysalis.barcode4j.output.AbstractCanvasProvider
deviceCenteredText, deviceJustifiedText, getDimensions, getOrientation
-
Constructor Details
-
EPSCanvasProvider
Main constructor.- Parameters:
out- OutputStream to write the EPS toorientation- the barcode orientation (0, 90, 180, 270)- Throws:
IOException- in case of an I/O problem
-
-
Method Details
-
getDecimalFormat
Returns the DecimalFormat instance to use internally to format numbers.- Returns:
- a DecimalFormat instance
-
finish
Writes the EPS trailer. Must be called after barcode painting call returns.- Throws:
IOException- if an I/O error happened during EPS generation
-
establishDimensions
Sets the dimensions of the barcode.- Specified by:
establishDimensionsin interfaceCanvasProvider- Overrides:
establishDimensionsin classAbstractCanvasProvider- Parameters:
dim- the dimensions of the barcode
-
deviceFillRect
public void deviceFillRect(double x, double y, double w, double h) Paints a filled rectangle.- Parameters:
x- x coordinate of the upper left cornery- y coordinate of the upper left cornerw- the widthh- the height
-
deviceText
public void deviceText(String text, double x1, double x2, double y1, String fontName, double fontSize, TextAlignment textAlign) Draws text.- Parameters:
text- the text to drawx1- the left boundaryx2- the right boundaryy1- the y coordinatefontName- the name of the fontfontSize- the size of the fonttextAlign- the text alignment
-