How to create, print PDF417 in Crystal Reports in ASP.NET, WinForms application?

Create PDF417 Barcodes in Crystal Reports Projects Using .NET Control

Generate and create 2D barcode PDF-417 in .NET Crystal Report using barcode library for Crystal Report

  • Simple to install and integrate PDF-417 barcode library into Visual Studio 2005/2008/2010
  • Have full control of PDF-417 including size, color, data mode, etc via C# or VB.NET
  • Managed code completely written in C# with strong-named and signed DLLs
  • Easy generation and barcode parameters customization with barcode generator for Crystal Report
  • Barcode generated completely compatible with latest barcode symbology standards
  • Display PDF-417 as high quality Gif, Tiff, Png images or save as Bitmap, Stream, Graphic objects
  • Source code is available with purchase of the unlimited developer license


How to create, print PDF417 in Crystal Reports in Visual Studio project?

  1. Download Crystal Reports PDF417 Barcode Generator library
  2. Install Crystal Reports Barcode Generator dll file into Visual Studio .NET project
  3. Start to Create










Introduction of PDF-417 Crystal Reports Barcode Generator

Top
PDF-417 barcode generator for Crystal Report is one function of our mature .NET barcode component, which is an easy-to-use .NET component with Xcopy deployment and creates PDF-417 in Crystal Report with C# or VB.NET sample code provided.

OnBarcode.com provides not only PDF-417 .NET Barcode SDK for Crystal Reports, but also other linear and 2D barcode generator for Crystal Report with detailed online how-to guide:
  • .NET Crystal Reports Linear Barcodes: Code 39, Code 128, EAN-8, EAN-13, GS1 128, UPC-A, UPC-E, Interleaved 2 of 5, Identcode, ISBN, ISSN, ITF-14, Leitcode, MSI Plessey, Intelligent mail barcode, Planet, Postnet, RM4SCC, etc
  • .NET Crystal Reports 2D Barcodes: including QR Code, Data Matrix, PDF-417




How to Generate PDF-417 in .NET Crystal Reports Barcode SDK

Top
This page guide provides a detailed, step-by-step methodology for generating, printing PDF417 (a 2D stacked linear barcode symbology) in Crystal Reports for .NET within ASP.NET and Windows Forms (.net framework) projects.

It covers core implementation, PDF417 data encoding, dimension size configuration, error correction, and advanced features to ensure seamless integration with Crystal Reports components and adherence to ISO industry standards.


Preparation

We includes two step by step tutorials on how to create new ASP.NET and Windows Forms .net framework projects to print barcodes in .rpt report file in .NET application. After you have created a new ASP.NET or Windows Forms project with the first barcode printed in the .rpt report, we will start to modify the tutoril to print PDF417 barcodes in the reports.


Print PDF417 in report designer and viewer

Follow these steps to generate PDF417 and embed it into a Crystal Report:
  1. Remove the existing Linear object generation C# code.
  2. Instantiate a PDF417 barcode object (core class for PDF417 2D barcode generation).
  3. Assign the target data string to the Data property (map to a Crystal Reports Parameter field for dynamic data).
  4. Invork method drawBarcodeAsBytes() to encode the Data Matrix barcode as a byte array and store it as a PNG image file in byte[] object (the standard format for Crystal Reports image controls in .rpt files).
  5. Run the ASP.NET/WinForms project and load the Crystal Report via CrystalReportViewer. Verify the PDF417 barcodes are displayed correctly in the report's Details section (or Report Header/Page Header).




PDF417 Barcode Data Characters Encoding in Crystal Reports for .NET (C#)

Top

PDF417 Valid Character Set

PDF417 (supported in Crystal Reports for .NET) supports the following character sets:
  • Full ASCII (128 characters defined in ISO/IEC 646).
  • Extended ASCII (values 128–255 per ISO 8859-1, ideal for multilingual Crystal Reports data).
  • Up to 811,800 distinct character sets/data interpretations (via ECI protocol).
  • Various function codewords for control operations (compatible with Crystal Reports Filtering logic).




PDF417 Data Encoding Mode

PDF417 supports three compact encoding modes (optimized for different data types in Crystal Reports):
  • Text Compaction mode: Encodes printable ASCII (32 - 126) and selected control characters (suited for Crystal Reports Summary field labels).
  • Byte Compaction mode: Encodes all 8-bit byte values (0 - 255), enabling international character support (compatible with ADO.NET DataSet binding).
  • Numeric Compaction mode: Efficiently encodes numeric data (ideal for Crystal Reports Group Header numeric identifiers).

Use the DataMode property to set encoding mode (auto-selection recommended for dynamic Crystal Reports data):




PDF417 Maximum Data Length (Error Correction Level 0)

Data capacity varies by encoding mode (critical for Crystal Reports Grouping large datasets):
  • Text Compaction mode: 1,850 characters.
  • Byte Compaction mode: 1,108 characters.
  • Numeric Compaction mode: 2,710 digits.

Note: Higher error correction levels reduce maximum data capacity. Adjust based on Crystal Reports report distribution requirements (e.g., physical printing may need higher ECL).




Encoding Text in PDF417 for Crystal Reports (C#)

Top

Generate PDF417 with ASCII Text

PDF417 supports all 128 ASCII characters (95 printable, 33 non-printable). Printable ASCII requires no special handling. You just enter the printing ASCII chars to property Data.

Encode Non-Printable ASCII Characters

Non-printable characters (e.g., carriage return) require tilde processing for Crystal Reports integration:
  1. Replace non-printable chars with '~' + 3-digit ASCII value (e.g. carriage return = ~013).
  2. Enable ProcessTilde = true to interpret the string tilde format.
PDF417 barcode = new PDF417();
barcode.ProcessTilde = true;
barcode.Data = "PDF417~013abc";



Note: Ensure your barcode scanner processes tilde-encoded characters to restore original values (critical for Crystal Reports data accuracy).




Generate PDF417 with Unicode Text

Encode Unicode text (multilingual data) for Crystal Reports in ASP.NET/WinForms:
  • Enable property EncodeUnicodeText to true to encode Unicode text string in PDF417 barcode.
PDF417 barcode = new PDF417();
barcode.EncodeUnicodeText = true;
barcode.Data = "unicode text here";




Additional Supported Data Formats

PDF417 in Crystal Reports supports advanced data formats:
  • Binary data: Encode raw binary files (e.g., serialized Crystal Reports Data Table data).
  • GS1 System messages: Comply with GS1 Application Identifier standards (for supply chain reports).
  • ECI mode: Encode extended character sets (e.g., Arabic, Cyrillic) for global Report distribution.




PDF417 Dimension Settings for Crystal Reports (C#)

Top
You can quickly customize generated PDF417 image width and height using the following C# codes in report project.
  • UOM: Unit of measure (PIXEL/CM/INCH, matches Crystal Reports report units).
  • Set the target PDF417 image width and height using property BarcodeWidth and BarcodeHeight

PDF417 barcode = new PDF417();
barcode.Data = "PDF-417";
barcode.UOM = UnitOfMeasure.INCH;
barcode.BarcodeWidth = 3;
barcode.BarcodeHeight = 1;



You can also further customize PDF417 dimensions to fit Crystal Reports layout (Header/Footer/Details sections) using these properties:
  • AutoResize: It must be false to enable property X and XtoYRatio.
  • X: Module width (minimum defined by application specs).
  • XtoYRatio: Bar width-to-height ratio (default: 0.3333333f).
  • RowCount: Number of rows (3–90).
  • ColumnCount: Number of columns (1–30).
  • LeftMargin/RightMargin/TopMargin/BottomMargin: Quiet zone (minimum 2X to avoid scanning errors).
Note: Ensure RowCount and ColumnCount align with the report’s PictureBox size to avoid layout overflow in Crystal Reports.




Advanced PDF417 Features for Crystal Reports (C#)

Top

Error Detection and Correction (ECL)

PDF417 includes error correction codewords (2 minimum) to ensure scan reliability (critical for physical report printing).

Use the ECL property to set the correction level in Crystal Reports ASP.NET, WinForms project:

Error Correction Level Total Error Correction Codewords Use Case for Crystal Reports
0 2 Digital-only report distribution
1 4 Low-risk physical printing
2 8 Standard physical printing
3 16 High-wear report use (e.g., shipping labels)
4 32 Industrial report printing
5 64 Extreme environmental conditions
6 128 Mission-critical reports
7 256 -
8 512 -




Compact (Truncated) PDF417

Create space-optimized PDF417 (for narrow Crystal Reports Details section) by enabling the Truncated property in C# code:

PDF417 barcode = new PDF417();
barcode.Data = "PDF417";
barcode.Truncated = true;



Note: Truncated PDF417 is not recommended for reports prone to physical damage (e.g., outdoor labels).




Macro PDF417

Macro PDF417 is similar to QR Code, Data Matrix Structured Append mode. Split large datasets (e.g. Crystal Reports Subreport data) across multiple PDF417 symbols:
  • Macro PDF417 supports up to 99,999 symbols per dataset.
  • Each symbol includes control information to reconstruct data (regardless of scan order).
  • Ideal for Crystal Reports with large Data Source datasets (e.g. enterprise-level Report scheduling).

Here are the PDF417 properties to create Macro PDF417 barcodes in Crystal Reports.
  • Set Macro to true to create macro PDF417 barcodes
  • In property MacroFileIndex to choose random file id for this PDF417 file.
  • In property MacroSegmentCount to specify the total number of segments for this PDF text file. In the C# example below, it is total 10 segements for the file.
  • In property MacroSegmentIndex to specify the order of the current PDF417 in the all segments. The order of the first symbol is 0.
PDF417 barcode = new PDF417();
barcode.Data = "MacroPDF";
barcode.Macro = true;
barcode.MacroFileIndex = 3;       
barcode.MacroSegmentCount = 10;   
barcode.MacroSegmentIndex = 2;     







Summary

Top
Now we have learned how to create, print PDF417 (a 2D stacked linear barcode symbology) in Crystal Reports and customize it using OnBarcode Barcode Generator for Crystal Reports C# library.

Print PDF417 in Report: Generate PDF417 in C# and bind it to Crystal Reports for .NET using ReportDocument, CrystalReportViewer, and .rpt file templates (compatible with ASP.NET Web Forms/WinForms PictureBox controls).

Process Complex Text Format: Use auto/manual encoding modes for ASCII/Unicode; handle non-printable characters with tilde processing (critical for Crystal Reports Formula field and Parameter field binding).

Customize PDF417: Customize dimensions, error correction levels, and compact mode to fit Crystal Reports layout (Header/Footer/Details sections), and use Macro PDF417 for large datasets in enterprise report distribution.

















Common Asked Questions

What is the use of PDF417 barcode?

PDF417 is a high density, 2-dimensional stacked barcode symbology. "PDF" stands for Portable Data File, and "417" signifies that each pattern in the code consists of 4 bars and spaces in a pattern that is 17 units (modules) long. PDF417 barcodes are used in a variety of industries and applications, such as identification cards, driver's license, airline boarding pass, transport, and inventory management.

Using .NET Crystal Reports Barcode Generator library, you can quickly create, print and insert PDF417 barcodes in Crystal reports in Visual Studio ASP.NET Core, WinForms projects.

What is the maximum capacity of a PDF417?

According to PDF standard (ISO/IEC 15438), the maximum number of characters encodable in a PDF417 barcode with lowest error correction level (0).
  • Text Compaction mode: 1,850 characters
  • Byte Compaction mode: 1,108 characters
  • Numeric Compaction mode: 2,710 characters
We recommend you to choose PDF417 data mode as auto mode, the Crystal Reports for .NET barcode library will automatically process the PDF417 encoding text characters and choose the right PDF417 data modes, and print PDF417 on Crystal report viewer in Visual Studio .NET IDE.

What is the aspect ratio of a PDF417?

The aspect ratio of the printed PDF417 barcode shall be defined by two dimensions:
  • X: set the dimension width of the narrowest bar and narrowest space.
  • Y: set the dimension height of the narrowest bar and narrowest space.
An aspect ratio of 2 means that the barcode's bar height (Y) is twice its width. The valid values of aspect ratio is from 2 to 3 (inclusive). In Crystal Reports for .NET report designer, you can apply the aspect ratio of PDF417 through properties X and Y.

What is the difference between a PDF417 and a QR Code?

PDF417 and QR Code are both 2D or matrix barcode symbologies. PDF417 is a barcode with linear rows of stacked codewords, and QR Code usually consists of black squares arranged in a square grid on a white background.

PDF417 can be scannable even if up to 50% of it is damaged. QR Code can accept up to 30% damages. Crystal Reports for .NET Barcode library supports both PDF417 and QR Code 2d barcode generations in Crystal report designer and report viewer in Windows Forms, ASP.NET Core web and Windows applications.




































Terms of Use | Privacy Policy
Copyright © OnBarcode.com . All rights reserved.