public class SVGCanvasProvider extends AbstractSVGGeneratingCanvasProvider
SVG_NAMESPACEbardim| Constructor and Description |
|---|
SVGCanvasProvider(boolean useNamespace,
int orientation)
Creates a new SVGCanvasProvider.
|
SVGCanvasProvider(DOMImplementation domImpl,
boolean useNamespace,
int orientation)
Creates a new SVGCanvasProvider.
|
SVGCanvasProvider(DOMImplementation domImpl,
String namespacePrefix,
int orientation)
Creates a new SVGCanvasProvider with namespaces enabled.
|
SVGCanvasProvider(int orientation)
Creates a new SVGCanvasProvider with default settings (with namespaces,
but without namespace prefix).
|
SVGCanvasProvider(String namespacePrefix,
int orientation)
Creates a new SVGCanvasProvider with namespaces enabled.
|
| Modifier and Type | Method and Description |
|---|---|
void |
deviceFillRect(double x,
double y,
double w,
double h)
Paints a filled rectangle.
|
void |
deviceText(String text,
double x1,
double x2,
double y1,
String fontName,
double fontSize,
TextAlignment textAlign)
Draws text.
|
void |
establishDimensions(BarcodeDimension dim)
Sets the dimensions of the barcode.
|
Document |
getDOM()
Returns the DOM document containing the SVG barcode.
|
DocumentFragment |
getDOMFragment()
Returns the DOM fragment containing the SVG barcode.
|
getNamespacePrefix, getQualifiedName, isNamespaceEnabledaddUnit, getDecimalFormatdeviceCenteredText, deviceJustifiedText, getDimensions, getOrientationpublic SVGCanvasProvider(String namespacePrefix, int orientation) throws BarcodeCanvasSetupException
namespacePrefix - the namespace prefix to use, null for no prefixorientation - the barcode orientation (0, 90, 180, 270)BarcodeCanvasSetupException - if setting up the provider failspublic SVGCanvasProvider(DOMImplementation domImpl, String namespacePrefix, int orientation) throws BarcodeCanvasSetupException
domImpl - DOMImplementation to use (JAXP default is used when
this is null)namespacePrefix - the namespace prefix to use, null for no prefixorientation - the barcode orientation (0, 90, 180, 270)BarcodeCanvasSetupException - if setting up the provider failspublic SVGCanvasProvider(boolean useNamespace,
int orientation)
throws BarcodeCanvasSetupException
useNamespace - Controls whether namespaces should be usedorientation - the barcode orientation (0, 90, 180, 270)BarcodeCanvasSetupException - if setting up the provider failspublic SVGCanvasProvider(DOMImplementation domImpl, boolean useNamespace, int orientation) throws BarcodeCanvasSetupException
domImpl - DOMImplementation to use (JAXP default is used when
this is null)useNamespace - Controls whether namespaces should be usedorientation - the barcode orientation (0, 90, 180, 270)BarcodeCanvasSetupException - if setting up the provider failspublic SVGCanvasProvider(int orientation)
throws BarcodeCanvasSetupException
orientation - the barcode orientation (0, 90, 180, 270)BarcodeCanvasSetupException - if setting up the provider failspublic Document getDOM()
public DocumentFragment getDOMFragment()
public void establishDimensions(BarcodeDimension dim)
establishDimensions in interface CanvasProviderestablishDimensions in class AbstractCanvasProviderdim - the dimensions of the barcodepublic void deviceFillRect(double x,
double y,
double w,
double h)
x - x coordinate of the upper left cornery - y coordinate of the upper left cornerw - the widthh - the heightpublic void deviceText(String text, double x1, double x2, double y1, String fontName, double fontSize, TextAlignment textAlign)
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 alignmentCopyright © 2003–2023. All rights reserved.