BarcodeRenderOptions Class
Options for rendering a linear barcode: as a scene, as SVG, and as an image or a PDF with the bridge packages.
public sealed class BarcodeRenderOptionsRemarks
The sizes are in the units of the scene: pixels in an image at the default scale, CSS pixels in SVG.
Constructors
| Name | Description |
|---|---|
| BarcodeRenderOptions() |
BarcodeRenderOptions()
BarcodeRenderOptions.cspublic BarcodeRenderOptions()No documentation is available.
Properties
| Name | Description |
|---|---|
| DarkPaint | Gets or sets the paint of the bars. Default is black. |
| LightPaint | Gets or sets the paint of the spaces, of the quiet zone and of the background of the text. Default is white. |
| ModuleHeight | Gets or sets the height of each module, which is the height of the bars. Default is 80. |
| ModuleWidth | Gets or sets the width of each module. Default is 2. |
| QuietZoneModules | Gets or sets the number of quiet zone modules on the left and right sides of the barcode. Default is 10. |
| SnapToPixels | Gets or sets a value indicating whether the module sizes and the positions are rounded to whole units. Default is true. |
| Text | Gets or sets the style of the human-readable text (Barcode.Text) printed under the bars. Default is null: no text. |
DarkPaint
BarcodeRenderOptions.csGets or sets the paint of the bars. Default is black.
public ScenePaint DarkPaint { get; set; }Property value
Remarks
A gradient is in the coordinates of the scene: (0, 0) is the top-left corner of the quiet zone.
LightPaint
BarcodeRenderOptions.csGets or sets the paint of the spaces, of the quiet zone and of the background of the text. Default is white.
public ScenePaint? LightPaint { get; set; }Property value
Remarks
null draws no background: it is transparent, or the content under the drawing shows through.
ModuleHeight
BarcodeRenderOptions.csGets or sets the height of each module, which is the height of the bars. Default is 80.
public double ModuleHeight { get; set; }Property value
Remarks
The rows of a stacked barcode (Barcode.IsStacked) are BarcodeRenderOptions.ModuleWidth high instead.
ModuleWidth
BarcodeRenderOptions.csQuietZoneModules
BarcodeRenderOptions.csSnapToPixels
BarcodeRenderOptions.csGets or sets a value indicating whether the module sizes and the positions are rounded to whole units. Default is true.
public bool SnapToPixels { get; set; }Property value
Remarks
Rounding gives every bar of one width the same width and sharp edges in images, which scanners read best. The module sizes round to the nearest whole number, at least 1. Set false to draw at the exact sizes.
Gets or sets the style of the human-readable text (Barcode.Text) printed under the bars. Default is null: no text.
public BarcodeTextOptions? Text { get; set; }Property value
Remarks
EAN-8, EAN-13, UPC-A and UPC-E print their digits as the GS1 General Specifications do: the guard bars extend 5 modules below the other bars, the digits are grouped between them, the digits that have no bars of their own are printed outside the bars (widening the quiet zone when it is too narrow), and the digits of an add-on are printed above its bars, which start lower. The font shrinks when a group is wider than the bars it is printed under.
The other symbologies print the text centered under the bars. A text wider than the barcode widens the drawing, and the barcode is centered above it.