File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other JSE/JEE APIs and the fly likes IReport and Barcode on PDF Output Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "IReport and Barcode on PDF Output" Watch "IReport and Barcode on PDF Output" New topic
Author

IReport and Barcode on PDF Output

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1390
Can someone help me on the issue of putting a barcode on a PDF output. I cannot find a PDF font in the field properties to use for barcode.
Vinod K Singh
Ranch Hand

Joined: Sep 30, 2008
Posts: 198
Use a barcode library e.g. Barbecue to generate the barcode and embed them as image in the report then export the report to PDF.


My Blog
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39534
    
  27
The iText library also supports barcodes.


Ping & DNS - updated with new look and Ping home screen widget
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1390
Originally posted by Ulf Dittmer:
The iText library also supports barcodes.


Can you give me some direction on how to use this. Currently I generate my report to PDF using JasperReports. However, I cannot figure out how to change a text field to display as a barcode.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39534
    
  27
A number of code examples are part of the iText tutorial: http://itextdocs.lowagie.com/tutorial/objects/images/tiff/index.php
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1390
Originally posted by Ulf Dittmer:
A number of code examples are part of the iText tutorial: http://itextdocs.lowagie.com/tutorial/objects/images/tiff/index.php



I have looked at the examples but don't understand how to tie the iText to the servlet that I use to generate the JasperReport. Is the idea to create a barcode image of the desired text then send that as a prameter?
[ October 08, 2008: Message edited by: Steve Dyke ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39534
    
  27
Ah, I skipped over the JasperReports part. This page and especially this piece of code make it sound as if barcodes are actually part of Jasper already (or can be added easily).
[ October 08, 2008: Message edited by: Ulf Dittmer ]
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1390
Do you have similar examples using the Barbecue.jar since it is included with JasperReports? I have tried several combinations of syntax but can not figure out the code for the Image Expression
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39534
    
  27
No, I really don't know the first thing about the Barbecue library, and not much more about JasperReport.
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1390
Thank you for all your responses. In a lot of this Java jungle I am clueless.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: IReport and Barcode on PDF Output
 
Similar Threads
barcode in jsp
Barcodes and Itext
generate barcode image
generate barcode in pdf format
AJAX responseText as pdf