Class PdfEan13Barcode
Represents the PdfEan13 barcode.
Inherited Members
Namespace: Syncfusion.Pdf.Barcode
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfEan13Barcode : PdfUnidimensionalBarcode
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 PdfEan13Barcode.
PdfEan13Barcode barcode = new PdfEan13Barcode();
//Set the barcode text.
barcode.Text = "4006381333931";
barcode.Location = new PointF(100,100);
//Draw a barcode in the new Page.
barcode.Draw(page);
//Save the document to disk.
document.Save("Ean13Barcode.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 PdfEan13Barcode.
Dim barcode As PdfEan13Barcode = New PdfEan13Barcode()
'Set the barcode text.
barcode.Text = "4006381333931"
barcode.Location = new PointF(100,100);
'Draw a barcode in the new Page.
barcode.Draw(page)
'Save the document to disk.
document.Save("Ean13Barcode.pdf")
Constructors
PdfEan13Barcode()
Initializes a new instance of the PdfEan13Barcode class.
Declaration
public PdfEan13Barcode()
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 PdfEan13Barcode.
PdfEan13Barcode barcode = new PdfEan13Barcode();
//Set the font to Ean13.
barcode.Font = font;
//Set the barcode text.
barcode.Text = "4006381333931";
//Draw a barcode in the new Page.
barcode.Draw(page, new PointF(25, 100));
//Save the document to disk.
document.Save("Ean13Barcode.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 font and font style.
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold)
'Creates a new PdfEan13Barcode.
Dim barcode As PdfEan13Barcode = New PdfEan13Barcode()
'Set the font to Ean13.
barcode.Font = font
'Set the barcode text.
barcode.Text = "4006381333931"
'Draw a barcode in the new Page.
barcode.Draw(page, new PointF(25, 100))
'Save the document to disk.
document.Save("Ean13Barcode.pdf")
PdfEan13Barcode(String)
Initializes a new instance of the PdfEan13Barcode class.
Declaration
public PdfEan13Barcode(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The Barcode text. |
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 PdfEan13Barcode.
PdfEan13Barcode barcode = new PdfEan13Barcode("4006381333931");
//Set the font to Ean13.
barcode.Font = font;
//Draw a barcode in the new Page.
barcode.Draw(page, new PointF(25, 100));
//Save the document to disk.
document.Save("Ean13Barcode.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 font and font style.
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold)
'Creates a new PdfEan13Barcode.
Dim barcode As PdfEan13Barcode = New PdfEan13Barcode("4006381333931")
'Set the font to Ean13.
barcode.Font = font
'Draw a barcode in the new Page.
barcode.Draw(page, new PointF(25, 100))
'Save the document to disk.
document.Save("Ean13Barcode.pdf")
Methods
Draw(PdfGraphics)
Draws the barcode on the PdfGraphics.
Declaration
public virtual void Draw(PdfGraphics graphics)
Parameters
Type | Name | Description |
---|---|---|
PdfGraphics | graphics | The PDF graphics. |
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 PdfEan13Barcode.
PdfEan13Barcode barcode = new PdfEan13Barcode();
//Set the barcode text.
barcode.Text = "4006381333931";
barcode.Location = new PointF(100,100);
//Draw a barcode in the new PdfGraphics.
barcode.Draw(graphics);
//Save the document to disk.
document.Save("Ean13Barcode.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 PdfEan13Barcode.
Dim barcode As PdfEan13Barcode = New PdfEan13Barcode()
'Set the barcode text.
barcode.Text = "4006381333931"
barcode.Location = new PointF(100,100);
'Draw a barcode in the new PdfGraphics.
barcode.Draw(graphics)
'Save the document to disk.
document.Save("Ean13Barcode.pdf")
Draw(PdfGraphics, PointF)
Draws the barcode on the PdfGraphics at the specified location.
Declaration
public virtual void Draw(PdfGraphics graphics, PointF location)
Parameters
Type | Name | Description |
---|---|---|
PdfGraphics | graphics | The pdf graphics. |
System.Drawing.PointF | location | The barcode location. |
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 PdfEan13Barcode.
PdfEan13Barcode barcode = new PdfEan13Barcode();
//Set the barcode text.
barcode.Text = "4006381333931";
//Draw a barcode in the new PdfGraphics.
barcode.Draw(graphics, new PointF(25, 500));
//Save the document to disk.
document.Save("Ean13Barcode.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 PdfEan13Barcode.
Dim barcode As PdfEan13Barcode = New PdfEan13Barcode()
'Set the barcode text.
barcode.Text = "4006381333931"
'Draw a barcode in the new Page.
barcode.Draw(graphics, New PointF(25, 500))
'Save the document to disk.
document.Save("Ean13Barcode.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 graphics. |
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 PdfEan13Barcode.
PdfEan13Barcode barcode = new PdfEan13Barcode();
//Set the barcode text.
barcode.Text = "4006381333931";
//Draw a barcode in the new PdfGraphics.
barcode.Draw(graphics, new PointF(25, 500), new SizeF(200,200));
//Save the document to disk.
document.Save("Ean13Barcode.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 PdfEan13Barcode.
Dim barcode As PdfEan13Barcode = New PdfEan13Barcode()
'Set the barcode text.
barcode.Text = "4006381333931"
'Draw a barcode in the new PdfGraphics.
barcode.Draw(graphics, New PointF(25, 500), New SizeF(200, 200))
'Save the document to disk.
document.Save("Ean13Barcode.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 PdfEan13Barcode.
PdfEan13Barcode barcode = new PdfEan13Barcode();
//Set the barcode text.
barcode.Text = "4006381333931";
//Draw a barcode in the new PdfGraphics.
barcode.Draw(graphics, new RectangleF(25, 100, 200, 200));
//Save the document to disk.
document.Save("Ean13Barcode.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 PdfEan13Barcode.
Dim barcode As PdfEan13Barcode = New PdfEan13Barcode()
'Set the barcode text.
barcode.Text = "4006381333931"
'Draw a barcode in the new PdfGraphics.
barcode.Draw(graphics, New RectangleF(25, 100, 200, 200))
'Save the document to disk.
document.Save("Ean13Barcode.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 PdfEan13Barcode.
PdfEan13Barcode barcode = new PdfEan13Barcode();
//Set the barcode text.
barcode.Text = "4006381333931";
//Draw a barcode in the new PdfGraphics.
barcode.Draw(graphics, 25, 100, 200, 200);
//Save the document to disk.
document.Save("Ean13Barcode.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 =pages.Graphics
'Creates a new PdfEan13Barcode.
Dim barcode As PdfEan13Barcode = New PdfEan13Barcode()
'Set the barcode text.
barcode.Text = "4006381333931"
'Draw a barcode in the new PdfGraphics.
barcode.Draw(graphics, 25, 100, 200, 200)
'Save the document to disk.
document.Save("Ean13Barcode.pdf")
Draw(PdfPageBase)
Draws the barcode on the PdfPage.
Declaration
public virtual void Draw(PdfPageBase page)
Parameters
Type | Name | Description |
---|---|---|
PdfPageBase | page | The PDF page. |
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 PdfEan13Barcode.
PdfEan13Barcode barcode = new PdfEan13Barcode();
//Set the barcode text.
barcode.Text = "4006381333931";
barcode.Location = new PointF(100,100);
//Draw a barcode in the new Page.
barcode.Draw(page);
//Save the document to disk.
document.Save("Ean13Barcode.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 PdfEan13Barcode.
Dim barcode As PdfEan13Barcode = New PdfEan13Barcode()
'Set the barcode text.
barcode.Text = "4006381333931"
barcode.Location = new PointF(100,100);
'Draw a barcode in the new Page.
barcode.Draw(page)
'Save the document to disk.
document.Save("Ean13Barcode.pdf")
Draw(PdfPageBase, PointF)
Draws the barcode on the PdfPage at the specified location.
Declaration
public virtual void Draw(PdfPageBase page, PointF location)
Parameters
Type | Name | Description |
---|---|---|
PdfPageBase | page | The pdf page. |
System.Drawing.PointF | location | The barcode location. |
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 PdfEan13Barcode.
PdfEan13Barcode barcode = new PdfEan13Barcode();
//Set the barcode text.
barcode.Text = "4006381333931";
//Draw a barcode in the new Page.
barcode.Draw(page, new PointF(25, 500));
//Save the document to disk.
document.Save("Ean13Barcode.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 PdfEan13Barcode.
Dim barcode As PdfEan13Barcode = New PdfEan13Barcode()
'Set the barcode text.
barcode.Text = "4006381333931"
'Draw a barcode in the new Page.
barcode.Draw(page, New PointF(25, 500))
'Save the document to disk.
document.Save("Ean13Barcode.pdf")
Draw(PdfPageBase, PointF, SizeF)
Draw PdfEan13Barcode 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 PdfEan13Barcode.
PdfEan13Barcode barcode = new PdfEan13Barcode();
//Set the barcode text.
barcode.Text = "4006381333931";
//Draw a barcode in the new Page.
barcode.Draw(page, new PointF(25, 500), new SizeF(200,200));
//Save the document to disk.
document.Save("Ean13Barcode.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 PdfEan13Barcode.
Dim barcode As PdfEan13Barcode = New PdfEan13Barcode()
'Set the barcode text.
barcode.Text = "4006381333931"
'Draw a barcode in the new Page.
barcode.Draw(page, New PointF(25, 500), New SizeF(200, 200))
'Save the document to disk.
document.Save("Ean13Barcode.pdf")
Draw(PdfPageBase, RectangleF)
Draw PdfEan13Barcode 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 PdfEan13Barcode.
PdfEan13Barcode barcode = new PdfEan13Barcode();
//Set the barcode text.
barcode.Text = "4006381333931";
//Draw a barcode in the new Page.
barcode.Draw(page, new RectangleF(25, 100, 200, 200));
//Save the document to disk.
document.Save("Ean13Barcode.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 PdfEan13Barcode.
Dim barcode As PdfEan13Barcode = New PdfEan13Barcode()
'Set the barcode text.
barcode.Text = "4006381333931"
'Draw a barcode in the new Page.
barcode.Draw(page, New RectangleF(25, 100, 200, 200))
'Save the document to disk.
document.Save("Ean13Barcode.pdf")
Draw(PdfPageBase, Single, Single, Single, Single)
Draw PdfEan13Barcode 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 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 PdfEan13Barcode.
PdfEan13Barcode barcode = new PdfEan13Barcode();
//Set the barcode text.
barcode.Text = "4006381333931";
//Draw a barcode in the new Page.
barcode.Draw(page, 25, 100, 200, 200);
//Save the document to disk.
document.Save("Ean13Barcode.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 PdfEan13Barcode.
Dim barcode As PdfEan13Barcode = New PdfEan13Barcode()
'Set the barcode text.
barcode.Text = "4006381333931"
'Draw a barcode in the new Page.
barcode.Draw(page, 25, 100, 200, 200)
'Save the document to disk.
document.Save("Ean13Barcode.pdf")
ToImage()
Exports the barcode as image.
Declaration
public override Image ToImage()
Returns
Type |
---|
System.Drawing.Image |
Overrides
Examples
//Creates a new PdfEan13Barcode.
PdfEan13Barcode barcode = new PdfEan13Barcode();
//Set the barcode text.
barcode.Text = "4006381333931";
//Get the image for PdfEan13Barcode.
Image image= barcode.ToImage();
//Save the image into Disk
image.Save("PdfEan13.png", ImageFormat.Png);
'Creates a new PdfEan13Barcode.
Dim barcode As PdfEan13Barcode = New PdfEan13Barcode()
'Set the barcode text.
barcode.Text = "4006381333931"
'Get the image for PdfEan13Barcode.
Dim image As Image = barcode.ToImage()
'Save the image into Disk
image.Save("PdfEan13.png", ImageFormat.Png)
ToImage(SizeF)
Declaration
public Image ToImage(SizeF size)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.SizeF | size |
Returns
Type |
---|
System.Drawing.Image |