This class contains information for writing PDF417/MicroPDF417 barcodes.
Syntax
Visual Basic (Declaration) | |
---|
Public Class BarcodeWritePdf |
C# | |
---|
public class BarcodeWritePdf |
Managed Extensions for C++ | |
---|
public __gc class BarcodeWritePdf |
C++/CLI | |
---|
public ref class BarcodeWritePdf |
Example
Visual Basic | Copy Code |
---|
Private Sub BarcodeWritePdfExample()
RasterCodecs.Startup()
Dim codecs As RasterCodecs = New RasterCodecs()
codecs.ThrowExceptionsOnInvalidImages = True
Dim image As RasterImage = codecs.Load("C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\barcode1.tif")
Dim barEngine As BarcodeEngine
Try
RasterSupport.Unlock(RasterSupportType.Barcodes1D, "TestKey")
BarcodeEngine.Startup(BarcodeMajorTypeFlags.Barcodes1d)
barEngine = New BarcodeEngine()
Dim data As BarcodeData = New BarcodeData()
Dim rc As Rectangle = New Rectangle(100, 100, 0, 0)
data.Unit = BarcodeUnit.ScanlinesPerPixels
data.Location = rc
data.SearchType = BarcodeSearchTypeFlags.Pdf417
Dim barcodeText As String()
barcodeText = New String(0) {}
barcodeText(0) = "PDF417 Symbol"
data.Data = BarcodeData.ConvertFromStringArray(barcodeText)
Dim barColor As BarcodeColor = New BarcodeColor()
barColor.BarColor = Color.Black
barColor.SpaceColor = Color.White
Dim bar1d As Barcode1d = New Barcode1d()
Dim barPDF As BarcodeWritePdf = New BarcodeWritePdf()
Dim barDM As BarcodeWriteDatamatrix = New BarcodeWriteDatamatrix()
Dim barQR As BarcodeWriteQr = New BarcodeWriteQr()
barPDF.AspectHeight = 0
barPDF.AspectWidth = 0
barPDF.Columns = 0
barPDF.Rows = 0
barPDF.EccLevel = BarcodePdf417EccLevelFlags.UsePercent
barPDF.EccPercentage = 50
barPDF.Justify = BarcodeJustifyFlags.Right
barPDF.Module = 21
barPDF.ModAspectRatio = 4
barEngine.Write(image, data, barColor, BarcodeWriteFlags.InitializationReader Or BarcodeWriteFlags.Truncate, bar1d, barPDF, barDM, barQR, Rectangle.Empty)
BarcodeEngine.Shutdown()
Catch ex As BarcodeException
MessageBox.Show(ex.Message)
End Try
RasterCodecs.Shutdown()
End Sub |
C# | Copy Code |
---|
private void BarcodeWritePdfExample() { // Load an image RasterCodecs.Startup(); RasterCodecs codecs = new RasterCodecs(); codecs.ThrowExceptionsOnInvalidImages = true; RasterImage image = codecs.Load(@"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\barcode1.tif"); BarcodeEngine barEngine; try { // Unlock linear barcode support. // Note that this is a sample key, which will not work in your toolkit RasterSupport.Unlock(RasterSupportType.Barcodes1D, "TestKey"); // Initialize linear barcodes BarcodeEngine.Startup(BarcodeMajorTypeFlags.Barcodes1d); barEngine = new BarcodeEngine(); BarcodeData data = new BarcodeData(); Rectangle rc = new Rectangle(100, 100, 0, 0); data.Unit = BarcodeUnit.ScanlinesPerPixels; data.Location = rc; data.SearchType = BarcodeSearchTypeFlags.Pdf417; string[] barcodeText; barcodeText = new string[1]; barcodeText[0] = "PDF417 Symbol"; data.Data = BarcodeData.ConvertFromStringArray(barcodeText); BarcodeColor barColor = new BarcodeColor(); barColor.BarColor = Color.Black; barColor.SpaceColor = Color.White; Barcode1d bar1d = new Barcode1d(); BarcodeWritePdf barPDF = new BarcodeWritePdf(); BarcodeWriteDatamatrix barDM = new BarcodeWriteDatamatrix(); BarcodeWriteQr barQR = new BarcodeWriteQr(); barPDF.AspectHeight = 0; barPDF.AspectWidth = 0; barPDF.Columns = 0; barPDF.Rows = 0; barPDF.EccLevel = BarcodePdf417EccLevelFlags.UsePercent; barPDF.EccPercentage = 50; barPDF.Justify = BarcodeJustifyFlags.Right; barPDF.Module = 21; barPDF.ModAspectRatio = 4; barEngine.Write(image, data, barColor, BarcodeWriteFlags.InitializationReader | BarcodeWriteFlags.Truncate, bar1d, barPDF, barDM, barQR, Rectangle.Empty); BarcodeEngine.Shutdown(); } catch (BarcodeException ex) { MessageBox.Show(ex.Message); } RasterCodecs.Shutdown(); } |
Remarks
Inheritance Hierarchy
Requirements
Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also