Class Pdf417Barcode
Represents the Pdf417 barcode.
Inherited Members
Namespace: Syncfusion.Pdf.Barcode
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class Pdf417Barcode : PdfBidimensionalBarcode
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Create font and font style.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold) ;
//Creates a new Pdf417Barcode.
Pdf417Barcode pdf417Barcode = new Pdf417Barcode();
//Set the barcode text.
pdf417Barcode.Text = "012345678";
pdf417Barcode.Location = new PointF(100,100);
//Draw a barcode in the new Page.
pdf417Barcode.Draw(page);
//Save the document to disk.
document.Save("417Barcode.pdf");
'Create a new PDF document.
Dim document As PdfDocument = New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Creates a new Pdf417Barcode.
Dim pdf417Barcode As Pdf417Barcode = New Pdf417Barcode()
'Set the barcode text.
pdf417Barcode.Text = "012345678"
pdf417Barcode.Location = new PointF(100,100);
'Draw a barcode in the new Page.
pdf417Barcode.Draw(page)
'Save the document to disk.
document.Save("417Barcode.pdf")
Constructors
Pdf417Barcode()
Declaration
public Pdf417Barcode()
Properties
ErrorCorrectionLevel
Gets or sets the error correction level.
Declaration
public Pdf417ErrorCorrectionLevel ErrorCorrectionLevel { get; set; }
Property Value
Type | Description |
---|---|
Pdf417ErrorCorrectionLevel |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Creates a new Pdf417Barcode.
Pdf417Barcode pdf417Barcode = new Pdf417Barcode();
//Set text.
pdf417Barcode.Text = "012345678";
//Set barcode size.
pdf417Barcode.Size = new SizeF(200, 200);
//Set the error correction level.
pdf417Barcode.ErrorCorrectionLevel = Pdf417ErrorCorrectionLevel.Auto;
//Set the dimention of the barcode.
pdf417Barcode.XDimension = 3;
//Set the barcode location.
pdf417Barcode.Location = new PointF(100, 100);
//Draw the barcode to PDF page.
pdf417Barcode.Draw(page);
//Save document to disk.
document.Save("output.pdf");
//Close the document.
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Creates a new Pdf417Barcode.
Dim pdf417Barcode As New Pdf417Barcode()
'Set text.
pdf417Barcode.Text = "012345678"
'Set barcode size.
pdf417Barcode.Size = New SizeF(200, 200)
'Set the error correction level.
pdf417Barcode.ErrorCorrectionLevel = PdfErrorCorrectionLevel.High
'Set the dimention of the barcode.
pdf417Barcode.XDimension = 5
'Set the barcode location.
pdf417Barcode.Location = New PointF(100, 100)
'Draw the barcode to PDF page.
pdf417Barcode.Draw(page)
'Save document to disk.
document.Save("output.pdf")
'Close the document.
document.Close(True)
Size
Gets or set the size of the barcode.
Declaration
public override SizeF Size { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.SizeF |
Overrides
Methods
Draw(PdfGraphics)
Draws the barcode on the PdfGraphics.
Declaration
public override void Draw(PdfGraphics graphics)
Parameters
Type | Name | Description |
---|---|---|
PdfGraphics | graphics | The PDF graphics. |
Overrides
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Create Pdf graphics for the page.
PdfGraphics graphics=page.Graphics;
//Create font and font style.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold) ;
//Creates a new Pdf417Barcode.
Pdf417Barcode pdf417Barcode = new Pdf417Barcode();
//Set the barcode text.
pdf417Barcode.Text = "012345678";
pdf417Barcode.Location = new PointF(100,100);
//Draw a barcode in the new PdfGraphics.
pdf417Barcode.Draw(graphics);
//Save the document to disk.
document.Save("417Barcode.pdf");
'Create a new PDF document.
Dim document As PdfDocument = New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Create Pdf graphics for the page.
Dim graphics As PdfGraphics=page.Graphics
'Creates a new Pdf417Barcode.
Dim pdf417Barcode As Pdf417Barcode = New Pdf417Barcode()
'Set the barcode text.
pdf417Barcode.Text = "012345678"
pdf417Barcode.Location = new PointF(100,100);
'Draw a barcode in the new PdfGraphics.
pdf417Barcode.Draw(graphics)
'Save the document to disk.
document.Save("417Barcode.pdf")
Draw(PdfGraphics, PointF)
Draws the barcode on the PdfGraphics at the specified location.
Declaration
public override void Draw(PdfGraphics graphics, PointF location)
Parameters
Type | Name | Description |
---|---|---|
PdfGraphics | graphics | The pdf graphics. |
System.Drawing.PointF | location | The barcode location. |
Overrides
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Create Pdf graphics for the page.
PdfGraphics graphics=page.Graphics;
//Create font and font style.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold) ;
//Creates a new Pdf417Barcode.
Pdf417Barcode pdf417Barcode = new Pdf417Barcode();
//Set the barcode text.
pdf417Barcode.Text = "012345678";
//Draw a barcode in the new PdfGraphics.
pdf417Barcode.Draw(graphics, new PointF(25, 500));
//Save the document to disk.
document.Save("417Barcode.pdf");
'Create a new PDF document.
Dim document As PdfDocument = New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Create Pdf graphics for the page.
Dim graphics As PdfGraphics =page.Graphics
'Creates a new Pdf417Barcode.
Dim pdf417Barcode As Pdf417Barcode = New Pdf417Barcode()
'Set the barcode text.
pdf417Barcode.Text = "012345678"
'Draw a barcode in the new PdfGraphics.
pdf417Barcode.Draw(graphics, New PointF(25, 500))
'Save the document to disk.
document.Save("417Barcode.pdf")
Draw(PdfGraphics, PointF, SizeF)
Draws the barcode on the PdfGraphics at the specified location.
Declaration
public void Draw(PdfGraphics graphics, PointF location, SizeF size)
Parameters
Type | Name | Description |
---|---|---|
PdfGraphics | graphics | The PDF graphics. |
System.Drawing.PointF | location | The location of the barcode on the PDF page. |
System.Drawing.SizeF | size | The size of the barcode. |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
// Create Pdf graphics for the page.
PdfGraphics graphics=page.Graphics;
//Create font and font style.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold) ;
//Creates a new Pdf417Barcode.
Pdf417Barcode pdf417Barcode = new Pdf417Barcode();
//Set the barcode text.
pdf417Barcode.Text = "012345678";
//Draw a barcode in the new PdfGraphics.
pdf417Barcode.Draw(graphics, new PointF(25, 500), new SizeF(200,200));
//Save the document to disk.
document.Save("417Barcode.pdf");
'Create a new PDF document.
Dim document As PdfDocument = New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Create Pdf graphics for the page.
Dim graphics As PdfGraphics = page.Graphics
'Creates a new Pdf417Barcode.
Dim pdf417Barcode As Pdf417Barcode = New Pdf417Barcode()
'Set the barcode text.
pdf417Barcode.Text = "012345678"
'Draw a barcode in the new PdfGraphics.
pdf417Barcode.Draw(graphics, New PointF(25, 500), New SizeF(200, 200))
'Save the document to disk.
document.Save("417Barcode.pdf")
Draw(PdfGraphics, RectangleF)
Draws the barcode on the PdfGraphics at the specified rectangle.
Declaration
public void Draw(PdfGraphics graphics, RectangleF rectangle)
Parameters
Type | Name | Description |
---|---|---|
PdfGraphics | graphics | The PDF graphics. |
System.Drawing.RectangleF | rectangle | The bounds of the barcode. |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Create Pdf graphics for the page.
PdfGraphics graphics=page.Graphics;
//Create font and font style.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold) ;
//Creates a new Pdf417Barcode.
Pdf417Barcode pdf417Barcode = new Pdf417Barcode();
//Set the barcode text.
pdf417Barcode.Text = "012345678";
//Draw a barcode in the new PdfGraphics.
pdf417Barcode.Draw(graphics, new RectangleF(25, 100, 200, 200));
//Save the document to disk.
document.Save("417Barcode.pdf");
'Create a new PDF document.
Dim document As PdfDocument = New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Create Pdf graphics for the page.
Dim graphics As PdfGraphics=page.Graphics
'Creates a new Pdf417Barcode.
Dim pdf417Barcode As Pdf417Barcode = New Pdf417Barcode()
'Set the barcode text.
pdf417Barcode.Text = "012345678"
'Draw a barcode in the new PdfGraphics.
pdf417Barcode.Draw(graphics, New RectangleF(25, 100, 200, 200))
'Save the document to disk.
document.Save("417Barcode.pdf")
Draw(PdfGraphics, Single, Single, Single, Single)
Draws the barcode based on the provided float values.
Declaration
public void Draw(PdfGraphics graphics, float x, float y, float width, float height)
Parameters
Type | Name | Description |
---|---|---|
PdfGraphics | graphics | The PDF graphics. |
System.Single | x | The x-coordinate of the upper-left corner of the bounding rectangle. |
System.Single | y | The y-coordinate of the upper-top corner of the bounding rectangle. |
System.Single | width | The width of the bounding rectangle. |
System.Single | height | The height of the bounding rectangle. |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Create Pdf graphics for the page.
PdfGraphics graphics=page.Graphics;
//Create font and font style.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold) ;
//Creates a new Pdf417Barcode.
Pdf417Barcode pdf417Barcode = new Pdf417Barcode();
//Set the barcode text.
pdf417Barcode.Text = "012345678";
//Draw a barcode in the new PdfGraphics.
pdf417Barcode.Draw(graphics, 25, 100, 200, 200);
//Save the document to disk.
document.Save("417Barcode.pdf");
'Create a new PDF document.
Dim document As PdfDocument = New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Create Pdf graphics for the page.
Dim graphics As PdfGraphics = page.Graphics
'Creates a new Pdf417Barcode.
Dim pdf417Barcode As Pdf417Barcode = New Pdf417Barcode()
'Set the barcode text.
pdf417Barcode.Text = "012345678"
'Draw a barcode in the new PdfGraphics.
pdf417Barcode.Draw(graphics, 25, 100, 200, 200)
'Save the document to disk.
document.Save("417Barcode.pdf")
Draw(PdfPageBase)
Draws the barcode on the PdfPage.
Declaration
public override void Draw(PdfPageBase page)
Parameters
Type | Name | Description |
---|---|---|
PdfPageBase | page | The PDF page. |
Overrides
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Create Pdf graphics for the page
PdfGraphics graphics=page.Graphics;
//Create font and font style.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold) ;
//Creates a new Pdf417Barcode.
Pdf417Barcode pdf417Barcode = new Pdf417Barcode();
//Set the barcode text.
pdf417Barcode.Text = "012345678";
pdf417Barcode.Location = new PointF(100,100);
//Draw a barcode in the new Page.
pdf417Barcode.Draw(page);
//Save the document to disk.
document.Save("417Barcode.pdf");
'Create a new PDF document.
Dim document As PdfDocument = New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Create Pdf graphics for the page
Dim graphics As PdfGraphics=page.Graphics
'Creates a new Pdf417Barcode.
Dim pdf417Barcode As Pdf417Barcode = New Pdf417Barcode()
'Set the barcode text.
pdf417Barcode.Text = "012345678"
pdf417Barcode.Location = new PointF(100,100);
'Draw a barcode in the new Page.
pdf417Barcode.Draw(page)
'Save the document to disk.
document.Save("417Barcode.pdf")
Draw(PdfPageBase, PointF)
Draws the barcode on the PdfPage at the specified location.
Declaration
public override void Draw(PdfPageBase page, PointF location)
Parameters
Type | Name | Description |
---|---|---|
PdfPageBase | page | The pdf page. |
System.Drawing.PointF | location | The barcode location. |
Overrides
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Create font and font style.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold) ;
//Creates a new Pdf417Barcode.
Pdf417Barcode pdf417Barcode = new Pdf417Barcode();
//Set the barcode text.
pdf417Barcode.Text = "012345678";
//Draw a barcode in the new Page.
pdf417Barcode.Draw(page, new PointF(25, 500));
//Save the document to disk.
document.Save("417Barcode.pdf");
'Create a new PDF document.
Dim document As PdfDocument = New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Creates a new Pdf417Barcode.
Dim pdf417Barcode As Pdf417Barcode = New Pdf417Barcode()
'Set the barcode text.
pdf417Barcode.Text = "012345678"
'Draw a barcode in the new Page.
pdf417Barcode.Draw(page, New PointF(25, 500))
'Save the document to disk.
document.Save("417Barcode.pdf")
Draw(PdfPageBase, PointF, SizeF)
Draw Pdf417Barcode based on location and size values.
Declaration
public void Draw(PdfPageBase page, PointF location, SizeF size)
Parameters
Type | Name | Description |
---|---|---|
PdfPageBase | page | The PDF page. |
System.Drawing.PointF | location | The location of the barcode on the PDF page. |
System.Drawing.SizeF | size | The size of the barcode. |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Create font and font style.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold) ;
//Creates a new Pdf417Barcode.
Pdf417Barcode pdf417Barcode = new Pdf417Barcode();
//Set the barcode text.
pdf417Barcode.Text = "012345678";
//Draw a barcode in the new Page.
pdf417Barcode.Draw(page, new PointF(25, 500), new SizeF(200,200));
//Save the document to disk.
document.Save("417Barcode.pdf");
'Create a new PDF document.
Dim document As PdfDocument = New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Creates a new Pdf417Barcode.
Dim pdf417Barcode As Pdf417Barcode = New Pdf417Barcode()
'Set the barcode text.
pdf417Barcode.Text = "012345678"
'Draw a barcode in the new Page.
pdf417Barcode.Draw(page, New PointF(25, 500), New SizeF(200, 200))
'Save the document to disk.
document.Save("417Barcode.pdf")
Draw(PdfPageBase, RectangleF)
Draw Pdf417Barcode based on rectangle input values.
Declaration
public void Draw(PdfPageBase page, RectangleF rectangle)
Parameters
Type | Name | Description |
---|---|---|
PdfPageBase | page | The PDF page. |
System.Drawing.RectangleF | rectangle | The bounds of the barcode. |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Create font and font style.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold) ;
//Creates a new Pdf417Barcode.
Pdf417Barcode pdf417Barcode = new Pdf417Barcode();
//Set the barcode text.
pdf417Barcode.Text = "012345678";
//Draw a barcode in the new Page.
pdf417Barcode.Draw(page, new RectangleF(25, 100, 200, 200));
//Save the document to disk.
document.Save("417Barcode.pdf");
'Create a new PDF document.
Dim document As PdfDocument = New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Creates a new Pdf417Barcode.
Dim pdf417Barcode As Pdf417Barcode = New Pdf417Barcode()
'Set the barcode text.
pdf417Barcode.Text = "012345678"
'Draw a barcode in the new Page.
pdf417Barcode.Draw(page, New RectangleF(25, 100, 200, 200))
'Save the document to disk.
document.Save("417Barcode.pdf")
Draw(PdfPageBase, Single, Single, Single, Single)
Draw Pdf417Barcode based on float input values.
Declaration
public void Draw(PdfPageBase page, float x, float y, float width, float height)
Parameters
Type | Name | Description |
---|---|---|
PdfPageBase | page | The PDF page. |
System.Single | x | The x-coordinate of the upper-left corner of the bounding rectangle. |
System.Single | y | The y-coordinate of the upper-top corner of the bounding rectangle. |
System.Single | width | The width of the bounding rectangle. |
System.Single | height | The height of the bounding rectangle. |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Create font and font style.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold) ;
//Creates a new Pdf417Barcode.
Pdf417Barcode pdf417Barcode = new Pdf417Barcode();
//Set the barcode text.
pdf417Barcode.Text = "012345678";
//Draw a barcode in the new Page.
pdf417Barcode.Draw(page, 25, 100, 200, 200);
//Save the document to disk.
document.Save("417Barcode.pdf");
'Create a new PDF document.
Dim document As PdfDocument = New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Creates a new Pdf417Barcode.
Dim pdf417Barcode As Pdf417Barcode = New Pdf417Barcode()
'Set the barcode text.
pdf417Barcode.Text = "012345678"
'Draw a barcode in the new Page.
pdf417Barcode.Draw(page, 25, 100, 200, 200)
'Save the document to disk.
document.Save("417Barcode.pdf")
ToImage()
Exports the barcode as image.
Declaration
public override Image ToImage()
Returns
Type | Description |
---|---|
System.Drawing.Image |
Overrides
Examples
//Creates a new Pdf417Barcode.
Pdf417Barcode pdf417Barcode = new Pdf417Barcode();
//Set the barcode text.
pdf417Barcode.Text = "012345678";
//Get the image for Pdf417Barcode.
Image image= pdf417Barcode.ToImage();
//Save the image into Disk
image.Save("Pdf417.png", ImageFormat.Png);
'Creates a new Pdf417Barcode.
Dim pdf417Barcode As Pdf417Barcode = New Pdf417Barcode()
'Set the barcode text.
pdf417Barcode.Text = "012345678"
'Get the image for Pdf417Barcode.
Dim image As Image = pdf417Barcode.ToImage()
'Save the image into Disk
image.Save("Pdf417.png", ImageFormat.Png)
ToImage(SizeF)
Declaration
public Image ToImage(SizeF size)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.SizeF | size |
Returns
Type | Description |
---|---|
System.Drawing.Image |