Class PdfDataMatrixBarcode
Represents the PDF datamatrix barcode.
Inherited Members
Namespace: Syncfusion.Pdf.Barcode
Assembly: Syncfusion.Pdf.Portable.dll
Syntax
public class PdfDataMatrixBarcode : 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();
//Creates a new PDF datamatrix barcode.
PdfDataMatrixBarcode datamatrix = new PdfDataMatrixBarcode();
//Sets the barcode text.
datamatrix.Text = "Test";
//Set the dimention of the barcode.
datamatrix.XDimension = 5;
//Set the barcode location.
datamatrix.Location = new PointF(100, 100);
//Draws a barcode on the new Page.
datamatrix.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 PDF datamatrix barcode.
Dim datamatrix As New PdfDataMatrixBarcode()
'Sets the barcode text.
datamatrix.Text = "Test"
'Set the dimention of the barcode.
datamatrix.XDimension = 5
'Set the barcode location.
datamatrix.Location = New PointF(100, 100)
'Draws a barcode on the new Page.
datamatrix.Draw(page)
'Save document to disk.
document.Save("output.pdf")
'Close the document.
document.Close(True)
Constructors
PdfDataMatrixBarcode()
Initialize a new instance of the PdfDataMatrixBarcode class.
Declaration
public PdfDataMatrixBarcode()
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 PDF datamatrix barcode.
PdfDataMatrixBarcode datamatrix = new PdfDataMatrixBarcode();
//Sets the barcode text.
datamatrix.Text = "Test";
//Set the dimention of the barcode.
datamatrix.XDimension = 5;
//Set the barcode location.
datamatrix.Location = new PointF(100, 100);
//Draws a barcode on the new Page.
datamatrix.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 PDF datamatrix barcode.
Dim datamatrix As New PdfDataMatrixBarcode()
'Sets the barcode text.
datamatrix.Text = "Test"
'Set the dimention of the barcode.
datamatrix.XDimension = 5
'Set the barcode location.
datamatrix.Location = New PointF(100, 100)
'Draws a barcode on the new Page.
datamatrix.Draw(page)
'Save document to disk.
document.Save("output.pdf")
'Close the document.
document.Close(True)
PdfDataMatrixBarcode(String)
Initialize a new instance of the PdfDataMatrixBarcode class.
Declaration
public PdfDataMatrixBarcode(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | Data to be converted as 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();
//Creates a new PDF datamatrix barcode.
PdfDataMatrixBarcode datamatrix = new PdfDataMatrixBarcode("Test");
//Set the dimention of the barcode.
datamatrix.XDimension = 5;
//Set the barcode location.
datamatrix.Location = new PointF(100, 100);
//Draws a barcode on the new Page.
datamatrix.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 PDF datamatrix barcode.
Dim datamatrix As New PdfDataMatrixBarcode("Test")
'Set the dimention of the barcode.
datamatrix.XDimension = 5
'Set the barcode location.
datamatrix.Location = New PointF(100, 100)
'Draws a barcode on the new Page.
datamatrix.Draw(page)
'Save document to disk.
document.Save("output.pdf")
'Close the document.
document.Close(True)
Properties
Encoding
Declaration
public PdfDataMatrixEncoding Encoding { get; set; }
Property Value
Type | Description |
---|---|
PdfDataMatrixEncoding |
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 PDF datamatrix barcode.
PdfDataMatrixBarcode datamatrix = new PdfDataMatrixBarcode();
//Set data matrix barcode encoding.
datamatrix.Encoding = PdfDataMatrixEncoding.ASCII;
//Sets the barcode text.
datamatrix.Text = "Test";
//Set the dimention of the barcode.
datamatrix.XDimension = 5;
//Set the barcode location.
datamatrix.Location = new PointF(100, 100);
//Draws a barcode on the new Page.
datamatrix.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 PDF datamatrix barcode.
Dim datamatrix As New PdfDataMatrixBarcode()
'Set data matrix barcode encoding.
datamatrix.Encoding = PdfDataMatrixEncoding.ASCII
'Sets the barcode text.
datamatrix.Text = "Test"
'Set the dimention of the barcode.
datamatrix.XDimension = 5
'Set the barcode location.
datamatrix.Location = New PointF(100, 100)
'Draws a barcode on the new Page.
datamatrix.Draw(page)
'Save document to disk.
document.Save("output.pdf")
'Close the document.
document.Close(True)
Size
Declaration
public PdfDataMatrixSize Size { get; set; }
Property Value
Type | Description |
---|---|
PdfDataMatrixSize |
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 PDF datamatrix barcode.
PdfDataMatrixBarcode datamatrix = new PdfDataMatrixBarcode();
//Sets the barcode text.
datamatrix.Text = "Test";
//Set the dimention of the barcode.
datamatrix.XDimension = 5;
//Set barcode size.
datamatrix.Size = PdfDataMatrixSize.Size20x20;
//Set the barcode location.
datamatrix.Location = new PointF(100, 100);
//Draws a barcode on the new Page.
datamatrix.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 PDF datamatrix barcode.
Dim datamatrix As New PdfDataMatrixBarcode()
'Sets the barcode text.
datamatrix.Text = "Test"
'Set the dimention of the barcode.
datamatrix.XDimension = 5
'Set barcode size.
datamatrix.Size = PdfDataMatrixSize.Size20x20
'Set the barcode location.
datamatrix.Location = New PointF(100, 100)
'Draws a barcode on the new Page.
datamatrix.Draw(page)
'Save document to disk.
document.Save("output.pdf")
'Close the document.
document.Close(True)
Methods
Draw(PdfPageBase)
Draws datamatrix in 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();
//Creates a new PDF datamatrix barcode.
PdfDataMatrixBarcode datamatrix = new PdfDataMatrixBarcode();
//Sets the barcode text.
datamatrix.Text = "Test";
//Set back color.
datamatrix.BackColor = new PdfColor(Color.Red);
//Set the dimention of the barcode.
datamatrix.XDimension = 5;
//Draws a barcode on the new Page.
datamatrix.Draw(page, new PointF(100,100));
//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 PDF datamatrix barcode.
Dim datamatrix As New PdfDataMatrixBarcode()
'Sets the barcode text.
datamatrix.Text = "Test"
'Set back color.
datamatrix.BackColor = New PdfColor(Color.Red)
'Set the dimention of the barcode.
datamatrix.XDimension = 5
'Draws a barcode on the new Page.
datamatrix.Draw(page, New PointF(100,100))
'Save document to disk.
document.Save("output.pdf")
'Close the document.
document.Close(True)
Draw(PdfPageBase, PointF)
Declaration
public override void Draw(PdfPageBase page, PointF location)
Parameters
Type | Name | Description |
---|---|---|
PdfPageBase | page | |
PointF | location |
Overrides
Draw(PdfPageBase, PointF, SizeF)
Draw DataMatrix barcode on Pdf Document.
Declaration
public void Draw(PdfPageBase page, PointF location, SizeF Size)
Parameters
Type | Name | Description |
---|---|---|
PdfPageBase | page | |
PointF | location | |
SizeF | Size |
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 PDF datamatrix barcode.
PdfDataMatrixBarcode datamatrix = new PdfDataMatrixBarcode();
//Sets the barcode text.
datamatrix.Text = "Test";
//Set back color.
datamatrix.BackColor = new PdfColor(Color.Red);
//Set the dimention of the barcode.
datamatrix.XDimension = 5;
//Draws a barcode on the new Page.
datamatrix.Draw(page, new PointF(100,100), new SizeF(200,200));
//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 PDF datamatrix barcode.
Dim datamatrix As New PdfDataMatrixBarcode()
'Sets the barcode text.
datamatrix.Text = "Test"
'Set back color.
datamatrix.BackColor = New PdfColor(Color.Red)
'Set the dimention of the barcode.
datamatrix.XDimension = 5
'Draws a barcode on the new Page.
datamatrix.Draw(page, New PointF(100,100), New SizeF(200,200))
'Save document to disk.
document.Save("output.pdf")
'Close the document.
document.Close(True)
Draw(PdfPageBase, RectangleF)
Draw DataMatrix Barcode in pdf document.
Declaration
public void Draw(PdfPageBase page, RectangleF Rectangle)
Parameters
Type | Name | Description |
---|---|---|
PdfPageBase | page | The PDF page to be drawn the barcode. |
RectangleF | Rectangle | The rectangle bounds of the rendering area. |
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 PDF datamatrix barcode.
PdfDataMatrixBarcode datamatrix = new PdfDataMatrixBarcode();
//Sets the barcode text.
datamatrix.Text = "Test";
//Set back color.
datamatrix.BackColor = new PdfColor(Color.Red);
//Set the dimention of the barcode.
datamatrix.XDimension = 5;
//Draws a barcode on the new Page.
datamatrix.Draw(page, new RectangleF(100, 100, 200, 200));
//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 PDF datamatrix barcode.
Dim datamatrix As New PdfDataMatrixBarcode()
'Sets the barcode text.
datamatrix.Text = "Test"
'Set back color.
datamatrix.BackColor = New PdfColor(Color.Red)
'Set the dimention of the barcode.
datamatrix.XDimension = 5
'Draws a barcode on the new Page.
datamatrix.Draw(page, New RectangleF(100, 100, 200, 200))
'Save document to disk.
document.Save("output.pdf")
'Close the document.
document.Close(True)
Draw(PdfPageBase, Single, Single, Single, Single)
Draw DataMatrix barcode in pdf document.
Declaration
public void Draw(PdfPageBase page, float x, float y, float Width, float Height)
Parameters
Type | Name | Description |
---|---|---|
PdfPageBase | page | The PDF page to be draw the barcode. |
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 bounding rectangle. |
System.Single | Width | The width of the barcode bounding rectangle. |
System.Single | Height | The height of the barcode 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();
//Creates a new PDF datamatrix barcode.
PdfDataMatrixBarcode datamatrix = new PdfDataMatrixBarcode();
//Sets the barcode text.
datamatrix.Text = "Test";
//Set back color.
datamatrix.BackColor = new PdfColor(Color.Red);
//Set the dimention of the barcode.
datamatrix.XDimension = 5;
//Draws a barcode on the new Page.
datamatrix.Draw(page, 100, 100, 200, 200);
//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 PDF datamatrix barcode.
Dim datamatrix As New PdfDataMatrixBarcode()
'Sets the barcode text.
datamatrix.Text = "Test"
'Set back color.
datamatrix.BackColor = New PdfColor(Color.Red)
'Set the dimention of the barcode.
datamatrix.XDimension = 5
'Draws a barcode on the new Page.
datamatrix.Draw(page, 100, 100, 200, 200)
'Save document to disk.
document.Save("output.pdf")
'Close the document.
document.Close(True)