barcode4j 2.1.0

org.krysalis.barcode4j.output.eps
Class EPSCanvasProvider

java.lang.Object
  extended by org.krysalis.barcode4j.output.AbstractCanvasProvider
      extended by org.krysalis.barcode4j.output.eps.EPSCanvasProvider
All Implemented Interfaces:
CanvasProvider

public class EPSCanvasProvider
extends AbstractCanvasProvider

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
EPSCanvasProvider(java.io.OutputStream out, int orientation)
          Main constructor.
 
Method Summary
 void deviceFillRect(double x, double y, double w, double h)
          Paints a filled rectangle.
 void deviceText(java.lang.String text, double x1, double x2, double y1, java.lang.String fontName, double fontSize, TextAlignment textAlign)
          Draws text.
 void establishDimensions(BarcodeDimension dim)
          Sets the dimensions of the barcode.
 void finish()
          Writes the EPS trailer.
protected  java.text.DecimalFormat getDecimalFormat()
          Returns the DecimalFormat instance to use internally to format numbers.
 
Methods inherited from class org.krysalis.barcode4j.output.AbstractCanvasProvider
deviceCenteredText, deviceJustifiedText, getDimensions, getOrientation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EPSCanvasProvider

public EPSCanvasProvider(java.io.OutputStream out,
                         int orientation)
                  throws java.io.IOException
Main constructor.

Parameters:
out - OutputStream to write the EPS to
orientation - the barcode orientation (0, 90, 180, 270)
Throws:
java.io.IOException - in case of an I/O problem
Method Detail

getDecimalFormat

protected java.text.DecimalFormat getDecimalFormat()
Returns the DecimalFormat instance to use internally to format numbers.

Returns:
a DecimalFormat instance

finish

public void finish()
            throws java.io.IOException
Writes the EPS trailer. Must be called after barcode painting call returns.

Throws:
java.io.IOException - if an I/O error happened during EPS generation

establishDimensions

public void establishDimensions(BarcodeDimension dim)
Sets the dimensions of the barcode.

Specified by:
establishDimensions in interface CanvasProvider
Overrides:
establishDimensions in class AbstractCanvasProvider
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 corner
y - y coordinate of the upper left corner
w - the width
h - the height

deviceText

public void deviceText(java.lang.String text,
                       double x1,
                       double x2,
                       double y1,
                       java.lang.String fontName,
                       double fontSize,
                       TextAlignment textAlign)
Draws text.

Parameters:
text - the text to draw
x1 - the left boundary
x2 - the right boundary
y1 - the y coordinate
fontName - the name of the font
fontSize - the size of the font
textAlign - the text alignment

barcode4j 2.1.0

Copyright © 2000-2010 Jeremias Maerki. All rights reserved.