BarCode.ExportToPdf(String) Method
Exports the bar code image to the specified file path in PDF format.
Namespace: DevExpress.BarCodes
Assembly: DevExpress.Docs.v25.1.dll
NuGet Package: DevExpress.Document.Processor
Declaration
Parameters
Name | Type | Description |
---|---|---|
fileName | String | The file name (including the full path) for the created PDF file. |
Remarks
The following code snippet exports the barcode as a PDF file with the specified settings:
BarCode barCode = new BarCode();
barCode.Symbology = Symbology.QRCode;
barCode.RotationAngle = 0;
barCode.CodeBinaryData = Encoding.Default.GetBytes("https://www.devexpress.com/");
barCode.Options.QRCode.CompactionMode = QRCodeCompactionMode.Byte;
barCode.Options.QRCode.ErrorLevel = QRCodeErrorLevel.Q;
barCode.Options.QRCode.ShowCodeText = true;
barCode.DpiX = 72;
barCode.DpiY = 72;
barCode.Module = 2f;
using (FileStream pdfFileStream = new FileStream("Exported_Barcode.pdf", FileMode.Create))
{
barCode.ExportToPdf(pdfFileStream);
}
To print the bar code, use the BarCode.Print or the BarCode.ShowPrintPreview method.
See Also