aspose 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
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: 1478
    
    1
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: 42608
    
  65
The iText library also supports barcodes.


Ping & DNS - my free Android networking tools app
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1478
    
    1
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: 42608
    
  65
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: 1478
    
    1
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: 42608
    
  65
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: 1478
    
    1
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: 42608
    
  65
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: 1478
    
    1
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