Class Barcode
Base class of all barcodes. Barcodes are drawn as vector graphics (one filled path), so they stay sharp at every zoom level and print resolution.
public abstract class Barcode
- Inheritance
-
Barcode
- Derived
- Inherited Members
Properties
Background
Optional background fill (including the quiet zone).
public PdfColor? Background { get; set; }
Property Value
Color
Color of the bars/modules (default black).
public PdfColor Color { get; set; }
Property Value
QuietZone
Width of the light margin on each side, in modules. Scanners need it; the default follows the symbology.
public int QuietZone { get; set; }
Property Value
Text
The encoded data.
public string Text { get; }
Property Value
TotalWidthModules
Total width in modules including the quiet zones.
public abstract int TotalWidthModules { get; }
Property Value
Methods
Draw(PdfCanvas, double, double, double, double)
Draws the barcode into the rectangle with the bottom-left corner (x, y).
The quiet zone is part of the rectangle. 2D codes keep square modules and are centered.
public abstract void Draw(PdfCanvas canvas, double x, double y, double width, double height)
Parameters
DrawWithModuleSize(PdfCanvas, double, double, double, double?)
Draws the barcode with a fixed module (narrow bar) size in points; returns the size used.
public PdfRectangle DrawWithModuleSize(PdfCanvas canvas, double x, double y, double moduleSize, double? height = null)