Can barcode saved as PDF file in raw data format?

We have a Jasper report with a barcode. After the report was generated and saved as PDF foramt. Our printer is not able to print the barcode and it was printed as black box. The reason was that printer doesn't have any printer drivers in order to gain printing speed for automation system.

The converted PDF report would have saved the barcode as an image instead of raw data and that's why the printer cannot handle it and printed the barcode as a black box.

Do we have any options to save the barcode in raw data format when converting a Jasper report into a PDF file?


jack.liang's picture
Joined: Jun 18 2021 - 8:45am
Last seen: 1 year 7 months ago

Can we save Jasper report in a different format so that barcode in the report can be in raw data format instead of being an image? What report formats that Jasper reports can be converted into? 

jack.liang - 1 year 7 months ago

We typically simply embed the barcode font in the PDF.  Sure, it makes the PDF larger, but it's manageable and our Brother label printers seem to handle it just fine.

I've tested some Linux Driverless printing (Printer Working Group), and gotten labels to print on label printers that support a format like 'image/pwg-raster', 'application/PCLm', 'image/jpeg' or 'application/postscript'. Not played with Apples proprietary 'image/urw', but it's certainly well supported on an enormous number of printers.  Granted you may have to convert that PDF, but IIRC, the new CUPS Driverless system does that natively via filters.

dspake - 9 months 3 days ago

1 Answer:

When I include a barcode in my reports I used the Barcode4j library which is an option within Jasper. The barcode appears fine on screen and then from my preview window I select save, choose the PDF type and then enter a filename with pdf extension. The file opens ok with PDF viewer on my mac and prints to a laser just fine.

There is a lot of code to look at by my project is at and you can download the source from there if it helps.

Are you using a barcode font by any chance ?

PDF icon Example barcodes in PDF5.07 KB
davidgarratt's picture
Joined: Sep 17 2013 - 8:13pm
Last seen: 7 months 3 days ago