Skip to main content

BarCode.ExportToPdf(Stream) Method

Exports the bar code to the specified stream in PDF format.

Namespace: DevExpress.BarCodes

Assembly: DevExpress.Docs.v25.1.dll

NuGet Package: DevExpress.Document.Processor

Declaration

public void ExportToPdf(
    Stream stream
)

Parameters

Name Type Description
stream Stream

A stream object to which the created document is exported.

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;
barCode.ExportToPdf("Exported_Barcode.pdf");

To print the bar code, use the BarCode.Print or the BarCode.ShowPrintPreview method.

See Also