Blogs

The One With

Rich Text Editor - Adding a Barcode into a Document

In my previous post Adding a chart into a Document, I showed you how you can create custom proprietary calculated field to render a live chart. Let’s use the same technique to render a barcode. I will reuse the existing barcode generators from our Reporting Suite.

Data Matrix Barcode

Field Code:

  • BRCODE (BARCODE is a reserved field, Final name TBD).

Switches:

  • \t – Specifies the barcode type. Supported barcodes.
  • \l – If this switch is set, the eye readable text will be drawn at the bottom of the barcode.
  • \w – Specifies the barcode width
  • \h – Specifies the barcode height
  • \d – Barcode Data
  • \p – Barcode specific option. For example for Code128, this switch determines the character set to be used. e.g. \p 128b
  • \r – This switch is used by a number of barcode types to determine the density. e.g. \r 2.6
  • \c \e \o \k – Barcode specific options. (See note below)

Example:

{BRCODE \t PDF417 \w 300 \h 150 \m text \r 3 \c 1 \p 3 \e 3 \o \l \d "PDF 417"}

Download the source code

Notes:

I should note that even though the techniques I am showing you here open up oh so many possibilities, don’t enable this for your users just yet. Give us some time to sort all the details outs Smile. And if you are an early adopter, send me an email with your questions, comments and suggestions. Especially if you have an interesting use-case for this.

Cheers

Azret

Published Jun 16 2011, 02:28 PM by Azret Botash (DevExpress)
Bookmark and Share

Comments

Martin Praxmarer - DevExpress MVP

Hi Azret,

Barcode is nice in a mailmerge scenario, we already use that since 2 years: www.devexpress.com/.../Q214507.aspx

June 16, 2011 6:55 PM

Sigurd Decroos

Oh yeah! Thx!

Now... Allow easy mail merge of OpenXML (byte array datafield...) automatically please.

June 17, 2011 9:36 PM
LIVE CHAT

Chat is one of the many ways you can contact members of the DevExpress Team.
We are available Monday-Friday between 7:30am and 4:30pm Pacific Time.

If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

FOLLOW US

DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

Your Privacy - Legal Statements

Copyright © 1998-2013 Developer Express Inc.
ALL RIGHTS RESERVED
All trademarks or registered trademarks
are property of their respective owners