Barcodes are used in various applications to connect the electronic world with a paper document or to gain access to additional information. TX Text Control supports the following barcode types:
- 14 one-dimensional barcodes including Code 39 and EAN.
- 6 two-dimensional barcodes including QR, DataMatrix and PDF417.
Adding Barcodes Programmatically
The following code uses a Server
╰ TXTextControl Namespace
╰ ServerTextControl Class
The ServerTextControl class implements a component that provide high-level text processing features for server-based applications. object to insert QR code into a new document.
The integrated barcodes have been designed for document processing purposes. For these requirements, it is essential that the barcode object doesn't displace other objects or text in the document. Therefore, the size must be fixed and the inner content should be resized instead.
This is controlled by the UpperTextLength property. This property defines the maximum number of characters. If the maximum number of characters is encrypted, it fills the complete space of the object. If less characters are encrypted, the barcode size doesn't change, but the content is getting smaller.
Merge Data into Barcodes
Any barcode can be dynamically filled with data during the merging process of the Mail
╰ DocumentServer Namespace
╰ MailMerge Class
The MailMerge class is a .NET component that can be used to effortlessly merge template documents with database content in .NET projects, such as ASP.NET web applications, web services or Windows services. class. The Name property of a barcode is used in the same way like merge fields to merge data. In the above code snippet, the Name property is set in line 16. Now, consider the following JSON merge data:
In a template, the data field uniqueId is bound to the barcode placeholder object:
The following code merges JSON data into a template that contains the barcode placeholder:
The following screenshot shows the resulting PDF with the merged QR Code:
See this live in one of our online demos:
Or test this on your own and download the fully-functional trial version.