aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes Text under barcode present on screen but not present when printing 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 "Text under barcode present on screen but not present when printing" Watch "Text under barcode present on screen but not present when printing" New topic
Author

Text under barcode present on screen but not present when printing

Curatolo Carlo
Greenhorn

Joined: Feb 03, 2009
Posts: 3
I just migrate to Java7u15, NetBeans 7.3, JasperReports 5.0 and iReports 5.0.1.

I have only one problem.

When I generate a report in iReport or in my java application, the text under the barcode (barcode4j 2.1 from JasperReports) is present on the screen or in the generated PDF file but not when printed on paper.

I tried to clean and rebuild everything...no change.

I uninstall java7u15 and installed java6u41 then everythink works fine everywhere.

I'am lost...please help.

Thanking you in advance.
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2864
    
  11

Hi Carlo, welcome to JavaRanch!

That's an odd problem. Are you printing the PDF to paper? If so, what program are you using to view and print the PDF?

Reinstalling Java isn't going to make a difference. The problem is going to be with the PDF settings, or possibly with how barcode4j is creating the barcode and its caption.
Curatolo Carlo
Greenhorn

Joined: Feb 03, 2009
Posts: 3
I use AcrobatReader 11.0.2 to open and print PDF files.

I have made some other tests last night and it is impossible to have the text under the barcode with java7 but always there with java6.

Another interresting test. I put a barbecue component on a report and the text under the barcode is always there, with java7 too.

But the text is smaller and lighter with barbecue I prefer barcode4j.

What can I do ?
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2864
    
  11

That's so bizarre that I think I must be misunderstanding something in your problem description. Let me see if I've got this all correct:

1. You create a PDF using Jasper Reports and Barcode4J under JDK 1.7. In the PDF viewed with Acrobat, you see a caption under the barcode, but when you print the PDF, the caption is gone.
2. You do the same thing with JDK 1.6, but now when you print the PDF, the caption prints as it displayed on the screen.
3. Other than the JDK, you don't change anything between these two cases. The versions of Jasper Report, Barcode4J, and any other supporting jars is exactly the same.

When you change JDKs are you also recompiling your code, and the Jasper Report jrxml file?

Curatolo Carlo
Greenhorn

Joined: Feb 03, 2009
Posts: 3
1.Not exact.
Is when I print from JasperView or iReport that the text Under the barcode is not on paper with java7 but present with java6

The generated PDF always contains the text and when I print from Acrobat the text is always on paper.

2. Exact

3. Exact

I tried everything. Recompile all (my application, jrxml files), partial recompile (only my application or only jrxml files) or keeping everything untouched.

Seems to me that the combinaison JasperReport, java7, barcode4j, JasperView generate that little bug...no text under a barcode when printing from the JasperView.
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2864
    
  11

Ah, that makes more sense. I couldn't figure out how the Java version could affect what Adobe Reader did with a PDF. JasperView is a Java application, so that's more vulnerable to changes in the JDK. I would guess there is some issue with your new JDK retrieving fonts, and it may be more related to configuration than that particular version. You might see if you can change the caption font for barcode4j to something extremely generic, like Serif. I don't know enough about barcode4j to help you more than that though. You might try the Jaspersoft Community forums at http://community.jaspersoft.com/answers for more information.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Text under barcode present on screen but not present when printing