PdfContents.DrawBarcode Method (Double, Double, TextJustify, Double, Double, Barcode, PdfFont, Double)

PDF File Writer

PdfContentsDrawBarcode Method (Double, Double, TextJustify, Double, Double, Barcode, PdfFont, Double)

Draw barcode

Namespace:  PdfFileWriter
Assembly:  PdfFileWriter (in PdfFileWriter.dll) Version: 1.1.24.0 (1.1.24.0)
Syntax
C#
public double DrawBarcode(
	double PosX,
	double PosY,
	TextJustify Justify,
	double BarWidth,
	double BarcodeHeight,
	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
BarcodeHeight
Type: SystemDouble
Barcode height
Barcode
Type: PdfFileWriterBarcode
Derived barcode class
TextFont (Optional)
Type: PdfFileWriterPdfFont
Text font
FontSize (Optional)
Type: SystemDouble
Text font size

Return Value

Type: Double
Barcode width
Remarks

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.

See Also