GdPicture.NET.14
GdPicture14 Namespace / GdPicturePDF Class / DrawBarcodePDF417 Method / DrawBarcodePDF417(String,BarcodePDF417EncodingMode,BarcodePDF417ErrorCorrectionLevel,Int32,Int32,Int32,Int32,Single,Single,Byte,Byte,Byte,Byte) Method
The data to encode using the required barcode symbol.
A member of the BarcodePDF417EncodingMode enumeration. The barcode encoding mode.

You can use the BarcodePDF417EncodingMode.BarcodePDF417EncodingModeUndefined to let the engine analyze the input and to select the most appropriate encoding mode.

A member of the BarcodePDF417ErrorCorrectionLevel enumeration. The error correction level.

You can use the BarcodePDF417ErrorCorrectionLevel.BarcodePDF417ErrorCorrectionLevelAuto to let the engine automatically determine the required level.

Specifies the number of rows constituting the barcode symbol.

A PDF417 symbol must have at least 3 rows and no more than 90. It is recommended to use 0 for automatic computation.

Specifies the number of columns constituting the barcode symbol.

A column refers to the set of codewords vertically. A PDF41 symbol may have 1 to 30 columns. It is recommended to use 0 for automatic computation.

The width of a module, in points.

Module is the smallest unit of a PDF417 symbol. The width of a module (width of the narrowest bar) is commonly referred as X dimension of the symbol, for more details on this please read the Remarks section below.

The height of each row, in points.

For better decodability, height should be no less than 2, for more details on this please read the Remarks section below.

The horizontal (X) coordinate of the destination point, expressed in the current units specified by the SetMeasurementUnit method with respect to the defined origin, related to the currently selected page.
The vertical (Y) coordinate of the destination point, expressed in the current units specified by the SetMeasurementUnit method with respect to the defined origin, related to the currently selected page.
The amount of cyan color to be used for the symbol's resulting color. Use the value between 0 and 255.
The amount of magenta to be used for the symbol's resulting color. Use the value between 0 and 255.
The amount of yellow to be used for the symbol's resulting color. Use the value between 0 and 255.
The amount of black color to be used for the symbol's resulting color. Use the value between 0 and 255.
Example





In This Topic
DrawBarcodePDF417(String,BarcodePDF417EncodingMode,BarcodePDF417ErrorCorrectionLevel,Int32,Int32,Int32,Int32,Single,Single,Byte,Byte,Byte,Byte) Method
In This Topic
Draws a required PDF417 barcode onto the currently selected page of the loaded PDF document according to your preference.

This method uses the CMYK color space for defining the desired fill color of the barcode symbol.

The coordinates and the dimensions of the PDF417 barcode symbol need to be set in the current units with respect to the currently located origin defined in the PDF document, related to the actual page, where the symbol is to be drawn. You can use the GetMeasurementUnit method to determine the currently defined units and you can use the SetMeasurementUnit method to reset the units according to your preference.

Syntax
'Declaration
 
Public Overloads Function DrawBarcodePDF417( _
   ByVal Data As String, _
   ByVal EncodingMode As BarcodePDF417EncodingMode, _
   ByVal ErrorCorrectionLevel As BarcodePDF417ErrorCorrectionLevel, _
   ByVal Rows As Integer, _
   ByVal Cols As Integer, _
   ByVal ModuleWidth As Integer, _
   ByVal RowHeight As Integer, _
   ByVal DstX As Single, _
   ByVal DstY As Single, _
   ByVal Cyan As Byte, _
   ByVal Magenta As Byte, _
   ByVal Yellow As Byte, _
   ByVal Black As Byte _
) As GdPictureStatus
public GdPictureStatus DrawBarcodePDF417( 
   string Data,
   BarcodePDF417EncodingMode EncodingMode,
   BarcodePDF417ErrorCorrectionLevel ErrorCorrectionLevel,
   int Rows,
   int Cols,
   int ModuleWidth,
   int RowHeight,
   float DstX,
   float DstY,
   byte Cyan,
   byte Magenta,
   byte Yellow,
   byte Black
)
public function DrawBarcodePDF417( 
    Data: String;
    EncodingMode: BarcodePDF417EncodingMode;
    ErrorCorrectionLevel: BarcodePDF417ErrorCorrectionLevel;
    Rows: Integer;
    Cols: Integer;
    ModuleWidth: Integer;
    RowHeight: Integer;
    DstX: Single;
    DstY: Single;
    Cyan: Byte;
    Magenta: Byte;
    Yellow: Byte;
    Black: Byte
): GdPictureStatus; 
public function DrawBarcodePDF417( 
   Data : String,
   EncodingMode : BarcodePDF417EncodingMode,
   ErrorCorrectionLevel : BarcodePDF417ErrorCorrectionLevel,
   Rows : int,
   Cols : int,
   ModuleWidth : int,
   RowHeight : int,
   DstX : float,
   DstY : float,
   Cyan : byte,
   Magenta : byte,
   Yellow : byte,
   Black : byte
) : GdPictureStatus;
public: GdPictureStatus DrawBarcodePDF417( 
   string* Data,
   BarcodePDF417EncodingMode EncodingMode,
   BarcodePDF417ErrorCorrectionLevel ErrorCorrectionLevel,
   int Rows,
   int Cols,
   int ModuleWidth,
   int RowHeight,
   float DstX,
   float DstY,
   byte Cyan,
   byte Magenta,
   byte Yellow,
   byte Black
) 
public:
GdPictureStatus DrawBarcodePDF417( 
   String^ Data,
   BarcodePDF417EncodingMode EncodingMode,
   BarcodePDF417ErrorCorrectionLevel ErrorCorrectionLevel,
   int Rows,
   int Cols,
   int ModuleWidth,
   int RowHeight,
   float DstX,
   float DstY,
   byte Cyan,
   byte Magenta,
   byte Yellow,
   byte Black
) 

Parameters

Data
The data to encode using the required barcode symbol.
EncodingMode
A member of the BarcodePDF417EncodingMode enumeration. The barcode encoding mode.

You can use the BarcodePDF417EncodingMode.BarcodePDF417EncodingModeUndefined to let the engine analyze the input and to select the most appropriate encoding mode.

ErrorCorrectionLevel
A member of the BarcodePDF417ErrorCorrectionLevel enumeration. The error correction level.

You can use the BarcodePDF417ErrorCorrectionLevel.BarcodePDF417ErrorCorrectionLevelAuto to let the engine automatically determine the required level.

Rows
Specifies the number of rows constituting the barcode symbol.

A PDF417 symbol must have at least 3 rows and no more than 90. It is recommended to use 0 for automatic computation.

Cols
Specifies the number of columns constituting the barcode symbol.

A column refers to the set of codewords vertically. A PDF41 symbol may have 1 to 30 columns. It is recommended to use 0 for automatic computation.

ModuleWidth
The width of a module, in points.

Module is the smallest unit of a PDF417 symbol. The width of a module (width of the narrowest bar) is commonly referred as X dimension of the symbol, for more details on this please read the Remarks section below.

RowHeight
The height of each row, in points.

For better decodability, height should be no less than 2, for more details on this please read the Remarks section below.

DstX
The horizontal (X) coordinate of the destination point, expressed in the current units specified by the SetMeasurementUnit method with respect to the defined origin, related to the currently selected page.
DstY
The vertical (Y) coordinate of the destination point, expressed in the current units specified by the SetMeasurementUnit method with respect to the defined origin, related to the currently selected page.
Cyan
The amount of cyan color to be used for the symbol's resulting color. Use the value between 0 and 255.
Magenta
The amount of magenta to be used for the symbol's resulting color. Use the value between 0 and 255.
Yellow
The amount of yellow to be used for the symbol's resulting color. Use the value between 0 and 255.
Black
The amount of black color to be used for the symbol's resulting color. Use the value between 0 and 255.

Return Value

A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK.

We strongly recommend always checking this status first.

Remarks
This method is only allowed for use with non-encrypted documents.

Just to remind you that the PDF417 barcode is usually printed at an X to Y ratio of 1:2 to 1:5, with 1:3 being the most popular. By lowering the ratio, a significant amount of space can be saved; however, some scanners cannot read X to Y ratios of less than 1:3.

Likewise, just to remind you that 1 point is equivalent to 1/72 of an inch.

Example
How to draw various PDF417 barcodes on the newly created page of the new PDF document.
Dim caption As String = "Example: DrawBarcodePDF417"
Dim gdpicturePDF As New GdPicturePDF()
Dim status As GdPictureStatus = gdpicturePDF.NewPDF()
If status = GdPictureStatus.OK Then
    gdpicturePDF.SetOrigin(PdfOrigin.PdfOriginTopLeft)
    gdpicturePDF.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitCentimeter)
    status = gdpicturePDF.NewPage(PdfPageSizes.PdfPageSizeLetter)
    If status = GdPictureStatus.OK Then
        If (gdpicturePDF.DrawBarcodePDF417("0123456789", BarcodePDF417EncodingMode.BarcodePDF417EncodingModeText, BarcodePDF417ErrorCorrectionLevel.BarcodePDF417ErrorCorrectionLevel2,
                                            16, 5, 2, 4, 2, 2, 0, 0, 0, 255) = GdPictureStatus.OK) AndAlso
           (gdpicturePDF.DrawBarcodePDF417("9876543210", BarcodePDF417EncodingMode.BarcodePDF417EncodingModeText, BarcodePDF417ErrorCorrectionLevel.BarcodePDF417ErrorCorrectionLevel2,
                                            32, 5, 4, 6, 2, 10, 0, 0, 0, 255) = GdPictureStatus.OK) Then
            status = gdpicturePDF.SaveToFile("DrawBarcodePDF417.pdf")
            If status = GdPictureStatus.OK Then
                MessageBox.Show("The example has been followed successfully and the file has been saved.", caption)
            Else
                MessageBox.Show("The example has been followed successfully, but the file can't be saved. Status: " + status.ToString(), caption)
            End If
        Else
            MessageBox.Show("The one of the DrawBarcodePDF417() method has failed with the status: " + gdpicturePDF.GetStat().ToString(), caption)
        End If
    Else
        MessageBox.Show("The NewPage() method has failed with the status: " + status.ToString(), caption)
    End If
Else
    MessageBox.Show("The NewPDF() method has failed with the status: " + status.ToString(), caption)
End If
gdpicturePDF.Dispose()
string caption = "Example: DrawBarcodePDF417";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
GdPictureStatus status = gdpicturePDF.NewPDF();
if (status == GdPictureStatus.OK)
{
    gdpicturePDF.SetOrigin(PdfOrigin.PdfOriginTopLeft);
    gdpicturePDF.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitCentimeter);
    status = gdpicturePDF.NewPage(PdfPageSizes.PdfPageSizeLetter);
    if (status == GdPictureStatus.OK)
    {
            if ((gdpicturePDF.DrawBarcodePDF417("0123456789", BarcodePDF417EncodingMode.BarcodePDF417EncodingModeText, BarcodePDF417ErrorCorrectionLevel.BarcodePDF417ErrorCorrectionLevel2,
                                                 16, 5, 2, 4, 2, 2, 0, 0, 0, 255) == GdPictureStatus.OK) &&
                (gdpicturePDF.DrawBarcodePDF417("9876543210", BarcodePDF417EncodingMode.BarcodePDF417EncodingModeText, BarcodePDF417ErrorCorrectionLevel.BarcodePDF417ErrorCorrectionLevel2,
                                                 32, 5, 4, 6, 2, 10, 0, 0, 0, 255) == GdPictureStatus.OK))
        {
            status = gdpicturePDF.SaveToFile("test_DrawBarcodePDF417.pdf");
            if (status == GdPictureStatus.OK)
                MessageBox.Show("The example has been followed successfully and the file has been saved.", caption);
            
            else
                MessageBox.Show("The example has been followed successfully, but the file can't be saved. Status: " + status.ToString(), caption);
        }
        else
            MessageBox.Show("The one of the DrawBarcodePDF417() method has failed with the status: " + gdpicturePDF.GetStat().ToString(), caption);
    }
    else
        MessageBox.Show("The NewPage() method has failed with the status: " + status.ToString(), caption);
}
else
    MessageBox.Show("The NewPDF() method has failed with the status: " + status.ToString(), caption);
gdpicturePDF.Dispose();
See Also