PdfContentsDrawBarcode Method (Double, Double, TextJustify, Double, Double, Color, Barcode, PdfFont, Double) |
Namespace: PdfFileWriter
Assembly: PdfFileWriter (in PdfFileWriter.dll) Version: 1.1.24.0 (1.1.24.0)

public double DrawBarcode( double PosX, double PosY, TextJustify Justify, double BarWidth, double BarHeight, Color BarColor, Barcode Barcode, PdfFont TextFont = null, double FontSize = 0 )
Parameters
- PosX
- Type: SystemDouble
Position X - PosY
- Type: SystemDouble
Position Y - Justify
- Type: PdfFileWriterTextJustify
Barcode justify (using TextJustify enumeration) - BarWidth
- Type: SystemDouble
Narrow bar width - BarHeight
- Type: SystemDouble
Barcode height - BarColor
- Type: System.DrawingColor
Barcode color - Barcode
- Type: PdfFileWriterBarcode
Derived barcode class - TextFont (Optional)
- Type: PdfFileWriterPdfFont
Text font - FontSize (Optional)
- Type: SystemDouble
Text font size
Return Value
Type: DoubleBarcode width

PosX can be the left, centre or right side of the barcode. The Justify argument controls the meaning of PosX. PosY is the position of the bottom side of the barcode. If optional text is displayed it will be displayed below PosY. If optional text is wider than the barcode it will be extended to the left and right sides of the barcode.
The BarWidth argument is the width of the narrow bar.
The BarcodeHeight argument is the height of the barcode excluding optional text.
Set Barcode to one of the derived classes. This library supports: Barcode128, Barcode39 and BarcodeEAN13. Note BarcodeEAN13 supports Barcode UPC-A.
Barcode text is optional. If TextFont and FontSize are omitted no text will be drawn under the barcode. If TextFont and FontSize are specified the barcode text will be displayed under the barcode. It will be horizontally centered in relation to the barcode.
Barcode text is displayed below PosY. Make sure to leave space under the barcode.
If color other than black is given make sure there is a good contrast to white.
