Skip to main content

MacroPdf417

Version: 9.0

cete.dynamicpdf.pageelements.barcoding.macropdf417

MacroPdf417​

Represents a MacroPdf417 barcode.

public class MacroPdf417 : Pdf417, ICoordinate, ISerializable
Public Class MacroPdf417
Inherits Pdf417
Implements ICoordinate, ISerializable

Inheritance: Object → PageElement → TaggablePageElement → Dim2Barcode → Pdf417 → MacroPdf417

Implements: ICoordinate, ISerializable

Licensing​

This class is a DynamicPDF Generator Enterprise Edition feature. One of the following licenses is required for non-evaluation usage:

  • DynamicPDF Generator for .NET Enterprise Edition
  • DynamicPDF Merger for .NET Enterprise Edition
  • DynamicPDF ReportWriter for .NET Enterprise Edition
  • DynamicPDF Core Suite for .NET Enterprise Edition

Examples​

The following example will place a MacroPdf417 barcode on the page.

Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements.BarCoding

Module MyModule

Sub Main()

' Create a PDF Document
Dim MyDocument As Document = New Document

' Create a Page and add it to the document
Dim MyPage As Page = New Page
MyDocument.Pages.Add(MyPage)

' Create a MacroPdf417 barcode
Dim macroPdf417 As MacroPdf417 = New MacroPdf417("MacroPdf417 barcode", _ 10.0f, 10.0f, 3, 2.0f)

' Add the MacroPdf417 barcode to the page
MyPage.Elements.Add(macroPdf417)

' Save the PDF
MyDocument.Draw("C:\MyDocument.pdf")

End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements.BarCoding;

class MyClass
{
static void Main()
{
// Create a PDF Document
Document document = new Document();

// Create a Page and add it to the document
Page page = new Page();
document.Pages.Add( page );

// Create a MacroPdf417 barcode
MacroPdf417 macroPdf417 = new MacroPdf417( "MacroPdf417 barcode", 10.0f, 10.0f, 3, 2.0f );

// Add the MacroPdf417 barcode to the page
page.Elements.Add( macroPdf417 );

// Save the PDF
document.Draw( @"C:\MyDocument.pdf" );
}
}

Remarks​

Class can be used to generate more than one PDF417 barcode symbols by taking input from the file.

Constructors​

MacroPdf417(Byte[], Single, Single, Int32, Int32, Single)​

Initializes a new instance of the MacroPdf417 class.

public MacroPdf417(Byte[] values, float x, float y, int columns, int rows, float xDimension)
Public Sub New (values As Byte(), x As Single, y As Single, columns As Integer, rows As Integer, xDimension As Single)

Parameters​

Byte array to be encoded.

The X coordinate of the macro PDF417 barcode.

The Y coordinate of the macro PDF417 barcode.

Columns of the macro PDF417 barcode.

Rows of the macro PDF417 barcode.

The XDimension of the macro PDF417 barcode.

MacroPdf417(Byte[], Single, Single, Int32, Single)​

Initializes a new instance of the MacroPdf417 class.

public MacroPdf417(Byte[] values, float x, float y, int columns, float xDimension)
Public Sub New (values As Byte(), x As Single, y As Single, columns As Integer, xDimension As Single)

Parameters​

Byte array to be encoded.

The X coordinate of the macro PDF417 barcode.

The Y coordinate of the macro PDF417 barcode.

Columns of the macro PDF417 barcode.

The XDimension of the macro PDF417 barcode.

MacroPdf417(String, Single, Single, Int32, Int32, Single)​

Initializes a new instance of the MacroPdf417 class.

public MacroPdf417(string value, float x, float y, int columns, int rows, float xDimension)
Public Sub New (value As String, x As Single, y As Single, columns As Integer, rows As Integer, xDimension As Single)

Parameters​

String to be encoded.

The X coordinate of the macro PDF417 barcode.

The Y coordinate of the macro PDF417 barcode.

Columns of the macro PDF417 barcode.

Rows of the macro PDF417 barcode.

The XDimension of the macro PDF417 barcode.

MacroPdf417(String, Single, Single, Int32, Single)​

Initializes a new instance of the MacroPdf417 class.

public MacroPdf417(string value, float x, float y, int columns, float xDimension)
Public Sub New (value As String, x As Single, y As Single, columns As Integer, xDimension As Single)

Parameters​

String to be encoded.

The X coordinate of the macro PDF417 barcode.

The Y coordinate of the macro PDF417 barcode.

Columns of the macro PDF417 barcode.

The XDimension of the macro PDF417 barcode.

Properties​

Address​

Gets or sets included address in the macro PDF417 barcode.

public string Address { get; set; }
Public Property Address As String

Property Value​

String

Angle​

Gets or sets the angle of the barcode. (Inherited from Dim2Barcode)

public float Angle { get; set; }
Public Property Angle As Single

Property Value​

Single

Color​

Gets or sets the Color for the barcode. (Inherited from Dim2Barcode)

public Color Color { get; set; }
Public Property Color As Color

Property Value​

Color

Compaction​

Gets or sets the type of compaction. (Inherited from Pdf417)

public Compaction Compaction { get; set; }
Public Property Compaction As Compaction

Property Value​

Compaction

CompactPdf417​

Gets or sets the Compact Pdf417. (Inherited from Pdf417)

public bool CompactPdf417 { get; set; }
Public Property CompactPdf417 As Boolean

Property Value​

Boolean

ErrorCorrection​

Gets or sets the error correction level for the PDF417 barcode. (Inherited from Pdf417)

public ErrorCorrection ErrorCorrection { get; set; }
Public Property ErrorCorrection As ErrorCorrection

Property Value​

ErrorCorrection

FileName​

Gets or sets included file name in the macro PDF417 barcode.

public string FileName { get; set; }
Public Property FileName As String

Property Value​

String

ID​

Gets or sets the ID of the page element. (Inherited from PageElement)

public string ID { get; set; }
Public Property ID As String

Property Value​

String

IncludeCheckSum​

Specifies whether check sum should be included in macro PDF417 barcode or not.

public bool IncludeCheckSum { set; }
Public Property IncludeCheckSum As Boolean

Property Value​

Boolean

IncludeFileSize​

Specifies whether file size should be included in macro PDF417 barcode or not.

public bool IncludeFileSize { set; }
Public Property IncludeFileSize As Boolean

Property Value​

Boolean

IncludeTimeStamp​

Specifies whether time stamp should be included in macro PDF417 barcode or not.

public bool IncludeTimeStamp { set; }
Public Property IncludeTimeStamp As Boolean

Property Value​

Boolean

PixelsPerXDimension​

Gets or Sets the pixels per XDimension (Inherited from Dim2Barcode)

public int PixelsPerXDimension { get; set; }
Public Property PixelsPerXDimension As Int32

Property Value​

Int32

Sender​

Gets or sets included sender in the macro PDF417 barcode.

public string Sender { get; set; }
Public Property Sender As String

Property Value​

String

Tag​

Gets or sets the tag of the taggable element. (Inherited from TaggablePageElement)

public Tag Tag { get; set; }
Public Property Tag As Tag

Property Value​

Tag

Licensing​

This property is a DynamicPDF Generator Enterprise Edition feature. One of the following licenses is required for non-evaluation usage:

  • DynamicPDF Generator for .NET Enterprise Edition
  • DynamicPDF Merger for .NET Enterprise Edition
  • DynamicPDF ReportWriter for .NET Enterprise Edition
  • DynamicPDF Core Suite for .NET Enterprise Edition

TagOrder​

Gets or sets the tag order of the taggable element. (Inherited from TaggablePageElement)

public int TagOrder { get; set; }
Public Property TagOrder As Int32

Property Value​

Int32

Value​

Gets or sets the value of the barcode. (Inherited from Pdf417)

public string Value { get; set; }
Public Property Value As String

Property Value​

String

X​

Gets or sets the X coordinate of the barcode. (Inherited from Dim2Barcode)

public float X { get; set; }
Public Property X As Single

Property Value​

Single

XDimension​

Gets or sets the xDimension of the barcode. (Inherited from Dim2Barcode)

public float XDimension { get; set; }
Public Property XDimension As Single

Property Value​

Single

XDimensionMilliMeters​

Gets or sets the XDimensionMilliMeters of the barcode. (Inherited from Dim2Barcode)

public float XDimensionMilliMeters { get; set; }
Public Property XDimensionMilliMeters As Single

Property Value​

Single

XDimensionMils​

Gets or sets the XDimensionMils of the barcode. (Inherited from Dim2Barcode)

public float XDimensionMils { get; set; }
Public Property XDimensionMils As Single

Property Value​

Single

XDimensionsPerCentiMeter​

Gets or sets the XDimensionsPerCentiMeter of the barcode. (Inherited from Dim2Barcode)

public float XDimensionsPerCentiMeter { get; set; }
Public Property XDimensionsPerCentiMeter As Single

Property Value​

Single

XDimensionsPerInch​

Gets or sets the XDimensionsPerInch of the barcode. (Inherited from Dim2Barcode)

public float XDimensionsPerInch { get; set; }
Public Property XDimensionsPerInch As Single

Property Value​

Single

Y​

Gets or sets the Y coordinate of the barcode. (Inherited from Dim2Barcode)

public float Y { get; set; }
Public Property Y As Single

Property Value​

Single

YDimension​

Gets or sets the yDimension of the barcode. (Inherited from Pdf417)

public float YDimension { get; set; }
Public Property YDimension As Single

Property Value​

Single

YDimensionMilliMeters​

Gets or sets the YDimensionMilliMeters of the barcode. (Inherited from Pdf417)

public float YDimensionMilliMeters { get; set; }
Public Property YDimensionMilliMeters As Single

Property Value​

Single

YDimensionMils​

Gets or sets the YDimensionMils of the barcode. (Inherited from Pdf417)

public float YDimensionMils { get; set; }
Public Property YDimensionMils As Single

Property Value​

Single

YDimensionsPerCentiMeter​

Gets or sets the YDimensionsPerCentiMeter of the barcode. (Inherited from Pdf417)

public float YDimensionsPerCentiMeter { get; set; }
Public Property YDimensionsPerCentiMeter As Single

Property Value​

Single

YDimensionsPerInch​

Gets or sets the YDimensionsPerInch of the barcode. (Inherited from Pdf417)

public float YDimensionsPerInch { get; set; }
Public Property YDimensionsPerInch As Single

Property Value​

Single

Methods​

Draw(PageWriter)​

Draws the macro PDF417 to the given PageWriter object.

public void Draw(PageWriter writer)
Sub Draw(writer As PageWriter)

Parameters​

PageWriter object to receive the macro PDF417's output.

Equals(Object)​

Determines whether the specified Object is equal to the current Object . (Inherited from Object)

public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean

Parameters​

The Object to compare with the current Object .

Returns​

true if the specified Object is equal to the current Object ; otherwise, false.

GetHashCode()​

Serves as a hash function for a particular type. (Inherited from Object)

public int GetHashCode()
Function GetHashCode() As Integer

Returns​

A hash code for the current Object .

GetOverflowMacroPdf417()​

Gets a new instance of the MacroPdf417 class.

public MacroPdf417 GetOverflowMacroPdf417()
Function GetOverflowMacroPdf417() As MacroPdf417

Returns​

Returns a MacroPdf417 object.

Examples​

The following example shows you how to use the GetOverflowMacroPdf417 method to allow MacroPdf417 barcodes to flow onto new pages as needed.

Imports System
Imports System.IO;
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements.BarCoding

Module MyModule
Sub Main()
' Create a PDF Document Dim MyDocument As Document = New Document
Dim bytArry(100) As Byte Try Dim fs As FileStream = New FileStream("C:/Textdata.txt", FileMode.Open) Dim avail As Integer = CType(fi.Length,Integer) ReDim bytArry(avial) fs.Read(bytArry, 0, avial) fs.Close() Catch e As System.Exception Console.WriteLine("EXCEPTION") End Try
Dim x As Single x = 10 Dim y As Single y = 10
' Create a MacroPdf417 barcode Dim macroPdf417 As MacroPdf417 = New MacroPdf417(bytArry, x, y, 14, 0.5F)
macroPdf417.FileName = "Textdata.txt" macroPdf417.Sender = "Your Name" macroPdf417.Address = "Your Address" macroPdf417.IncludeFileSize = True macroPdf417.IncludeCheckSum = True macroPdf417.IncludeTimeStamp = True macroPdf417.SetFileID(22222222)
Do
' Create a Page Dim MyPage As Page = New Page
' Add the MacroPdf417 barcode to the page MyPage.Elements.Add( macroPdf417 )
' Add Page to the document MyDocument.Pages.Add(MyPage)
' if there is no overflow MacroPdf417 set to null macroPdf417 = macroPdf417.GetOverflowMacroPdf417() Loop While Not macroPdf417 Is Nothing
' Save the PDF MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using System.IO;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements.BarCoding;

class MyClass
{static void Main(){ // Create a PDF Document Document document = new Document();
byte[] bytArry = null; try { FileStream fs = new FileStream( @"C:/Textdata.txt", FileMode.Open ); bytArry = new byte[fs.Length]; fs.Read( bytArry, 0, (int)fs.Length ); fs.Close(); } catch( Exception e ) { Console.WriteLine( "EXCEPTION "+e.Message ); }
float x = 10.0f; float y = 10.0f;;
// Create a MacroPdf417 barcode MacroPdf417 macroPdf417 = new MacroPdf417( bytArry, x, y, 14, 0.5f );
macroPdf417.FileName = "Textdata.txt"; macroPdf417.Sender = "Your Name"; macroPdf417.Address = "Your Address"; macroPdf417.IncludeFileSize = true; macroPdf417.IncludeCheckSum = true; macroPdf417.IncludeTimeStamp = true; macroPdf417.SetFileID(22222222);
do { // Create a Page Page page = new Page();
// Add the MacroPdf417 barcode to the page page.Elements.Add( macroPdf417 );
// Add it to the document document.Pages.Add( page );
macroPdf417 = macroPdf417.GetOverflowMacroPdf417(); } while( macroPdf417 != null );
// Save the PDF document.Draw( @"C:\MyDocument.pdf" );}
}

Remarks​

This method returns a new MacroPdf417 object that contains the remaining data that did not fit.

GetOverflowMacroPdf417(Single, Single)​

Gets a new instance of the MacroPdf417 class.

public MacroPdf417 GetOverflowMacroPdf417(float x, float y)
Function GetOverflowMacroPdf417(x As Single, y As Single) As MacroPdf417

Parameters​

The X coordinate of the macro PDF417 barcode.

The Y coordinate of the macro PDF417 barcode.

Returns​

Returns a MacroPdf417 object.

Examples​

The following example shows you how to use the GetOverflowMacroPdf417 method with x and y co ordinates to allow MacroPdf417 barcodes to flow onto new pages as needed.

Imports System
Imports System.IO;
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements.BarCoding

Module MyModule
Sub Main()
' Create a PDF Document Dim MyDocument As Document = New Document
' Create a Page and add it to the document Dim MyPage As Page = New Page MyDocument.Pages.Add(MyPage)
Dim bytArry(100) As Byte Try Dim fs As FileStream = New FileStream("C:/Textdata.txt", FileMode.Open) Dim avail As Integer = CType(fi.Length,Integer) ReDim bytArry(avail) fs.Read(bytArry, 0, avail) fs.Close() Catch e As System.Exception Console.WriteLine("EXCEPTION") End Try
Dim x As Single x = 10 Dim y As Single y = 10
' Create a MacroPdf417 barcode Dim macroPdf417 As MacroPdf417 = New MacroPdf417(bytArry, x, y, 14, 0.5F)
macroPdf417.FileName = "Textdata.txt" macroPdf417.Sender = "Your Name" macroPdf417.Address = "Your Address" macroPdf417.IncludeFileSize = True macroPdf417.IncludeCheckSum = True macroPdf417.IncludeTimeStamp = True macroPdf417.SetFileID(22222222)
' Add the MacroPdf417 barcode to the page MyPage.Elements.Add( macroPdf417 )
y = y + macroPdf417.GetSymbolHeight() + 20
Dim objMacroPdf417 As MacroPdf417 Do objMacroPdf417 = macroPdf417.GetOverflowMacroPdf417(x, y) If Not (objMacroPdf417 Is Nothing) then Mypage.Elements.Add(objMacroPdf417) y = y + objMacroPdf417.GetSymbolHeight() + 20 End If Loop Until Not (objMacroPdf417 Is Nothing)
' Save the PDF MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using System.IO;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements.BarCoding;

class MyClass
{static void Main(){ // Create a PDF Document Document document = new Document();
// Create a Page and add it to the document Page page = new Page(); document.Pages.Add( page );
byte[] bytArry = null; try { FileStream fs = new FileStream( @"C:/Textdata.txt", FileMode.Open ); bytArry = new byte[fs.Length]; fs.Read( bytArry, 0, (int)fs.Length ); fs.Close(); } catch( Exception e ) { Console.WriteLine( "EXCEPTION "+e.Message ); }
float x = 10.0f; float y = 10.0f;
// Create a MacroPdf417 barcode MacroPdf417 macroPdf417 = new MacroPdf417( bytArry, x, y, 14, 0.5f );
macroPdf417.FileName = "Textdata.txt"; macroPdf417.Sender = "Your Name"; macroPdf417.Address = "Your Address"; macroPdf417.IncludeFileSize = true; macroPdf417.IncludeCheckSum = true; macroPdf417.IncludeTimeStamp = true; macroPdf417.SetFileID(22222222);
// Add the MacroPdf417 barcode to the page page.Elements.Add( macroPdf417 );
y += macroPdf417.GetSymbolHeight() + 20.0f;
MacroPdf417 objMacroPdf417 = null; do { objMacroPdf417 = macroPdf417.GetOverflowMacroPdf417( x, y ); if( objMacroPdf417 != null ) { page.Elements.Add( objMacroPdf417 ); y += objMacroPdf417.GetSymbolHeight() + 20.0f; } } while( objMacroPdf417 != null );
// Save the PDF document.Draw( @"C:\MyDocument.pdf" );}
}

Remarks​

This method returns a new MacroPdf417 object that contains the remaining data that did not fit.

GetSymbolHeight()​

Returns the height required to display the PDF417 barcode.

public float GetSymbolHeight()
Function GetSymbolHeight() As Single

Returns​

A value representing the required height.

GetSymbolWidth()​

Returns the width required to display the macro PDF417 barcode.

public float GetSymbolWidth()
Function GetSymbolWidth() As Single

Returns​

A value representing the required width.

GetType()​

Gets the Type of the current instance. (Inherited from Object)

public Type GetType()
Function GetType() As Type

Returns​

The Type instance that represents the exact runtime type of the current instance.

SetFileID(Int32)​

Sets the file ID for the macro PDF417 barcode.

public void SetFileID(int fileId)
Sub SetFileID(fileId As Integer)

Parameters​

The file ID of the macro PDF417 barcode.

SetFileID(Int32[])​

Sets the file ID using an array of base 900 numbers (0 to 899).

public void SetFileID(Int32[] fileIdArray)
Sub SetFileID(fileIdArray As Int32[])

Parameters​

The file ID of the macro PDF417 barcode provided as an array of base 900 numbers (0 to 899).

ToString()​

Returns a String that represents the current Object . (Inherited from Object)

public string ToString()
Function ToString() As String

Returns​

A String that represents the current Object .

See Also​

ceTe.DynamicPDF.PageElements.BarCoding