Hitachi Vantara Pentaho Community Forums
Results 1 to 9 of 9

Thread: Error printing report on Apple Mac

  1. #1
    Join Date
    Dec 2007
    Posts
    9

    Default Error printing report on Apple Mac

    One of my applications uses jfreereport-0.8.6-6 for printing. All was fine until today, but now, some customers told me that when printing the lines overlap. This happens when using the new Oracle JRE for Mac OS X - Version 7 Update 9 on OS X Mountain Lion - OS X 10.8.2. I tried to solve updating libraries. Now I am using Pentaho Reporting Software Developer's Kit (SDK) 3.9.1, but the problem is still here. The lines overlap either in preview either when printing, but not when exporting as pdf. On Linux and Windows the problem doesn't arise. I changed also the font from SansSerif to Arial, with no results. I attach:
    1. the xml file used to define the report
    2. the pdf print on Mac
    3. the pdf print on Linux (the Windows version is identical)

    Thanks in advance for your help.
    Attached Files Attached Files

  2. #2
    Join Date
    Mar 2003
    Posts
    8,090

    Default

    Your Mac PDF does not use the correct fonts. Could it be that you use "Gatekeeper"? I bet that your application cannot access the font files in "/Library/Fonts" and thus you should see loads of warnings coming up when exporting.

    Increase the log level 'insanely detailed' and see what the boot-up of the reporting engine prints out. LibFonts should register all fonts upon startup.

    PS: I am working on a Mac, but I use Apple's JDK and everything works fine. I have never tried using it on a Oracle-JDK on a mac, nor did I ever enable gatekeeper to its most paranoid level.

    Any exception you encounter in the logs - post it.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  3. #3
    Join Date
    Dec 2007
    Posts
    9

    Default

    Correction:
    In addiction to exported PDF, also the preview window is right, only the physical print on printer or PDF is wrong.

    No Gatekeeper.
    If I run my application (davide.jar) from command line in a terminal window by:
    java -jar davide.jar
    the standard Apple JRE 1.6 starts and all is fine. If I run the application by double click, the Java Launcher of Oracle JRE 1.7 starts and the problem arises.

    I setted:
    <level value="DEBUG"/>
    in log4j.xml at root to obtain the following output of the libraries, but no error or exception is shown:

    dic 06, 2012 7:38:08 PM org.pentaho.reporting.libraries.base.boot.AbstractBoot start
    INFO: LibBase 1.2.8.16112 started.
    dic 06, 2012 7:38:08 PM org.pentaho.reporting.libraries.base.boot.AbstractBoot start
    INFO: LibSerializer 1.2.8.16112 started.
    dic 06, 2012 7:38:08 PM org.pentaho.reporting.libraries.base.boot.AbstractBoot start
    INFO: LibLoader 1.2.8.16112 started.
    dic 06, 2012 7:38:08 PM org.pentaho.reporting.libraries.base.boot.AbstractBoot start
    INFO: LibFormula 1.2.8.16112 started.
    dic 06, 2012 7:38:08 PM org.pentaho.reporting.libraries.base.boot.AbstractBoot start
    INFO: LibFonts 1.2.8.16112 started.
    dic 06, 2012 7:38:08 PM org.pentaho.reporting.libraries.base.boot.AbstractBoot start
    INFO: LibFormat 1.2.8.16112 started.
    dic 06, 2012 7:38:08 PM org.pentaho.reporting.libraries.base.boot.AbstractBoot start
    INFO: LibXML 1.2.8.16112 started.
    dic 06, 2012 7:38:08 PM org.pentaho.reporting.libraries.base.boot.AbstractBoot start
    INFO: LibRepository 1.2.8.16112 started.
    dic 06, 2012 7:38:08 PM org.pentaho.reporting.libraries.base.boot.AbstractBoot start
    INFO: LibDocBundle 1.2.8.16112 started.
    dic 06, 2012 7:38:09 PM org.pentaho.reporting.libraries.fonts.registry.AbstractFontFileRegistry registerDefaultFontPath
    INFO: Completed font registration.
    dic 06, 2012 7:38:10 PM org.pentaho.reporting.libraries.fonts.registry.AbstractFontFileRegistry registerDefaultFontPath
    INFO: Completed font registration.
    dic 06, 2012 7:38:10 PM org.pentaho.reporting.libraries.fonts.registry.AbstractFontFileRegistry registerDefaultFontPath
    INFO: Completed font registration.
    dic 06, 2012 7:38:10 PM org.pentaho.reporting.libraries.base.boot.AbstractBoot start
    INFO: Pentaho Reporting Engine Classic 3.9.1-GA.16112 started.
    dic 06, 2012 7:39:11 PM org.pentaho.reporting.engine.classic.core.cache.DataCacheFactory getCache
    INFO: Unable to create valid cache, returning <null>

  4. #4
    Join Date
    Mar 2003
    Posts
    8,090

    Default

    I finally had a chance to properly look into the issue.

    The cause of the bug is simple:
    We detect the Mac OS system by looking for a "mrj.version" system property. That used to work nicely for all Apple JDKS (as apple is rather chaotic with all other properties they set). But it breaks with the Oracle JDK, because *they* set the properties as it is originally documented, and do not use the Apple "mrj" set of properties.

    Well, for PRD-3.9, the solution is simple: Start your java with "-Dmrj.version=I_HATE_APPLE" and you will be fine.

    For all upcoming releases this is fixed so that you wont have to do any manual hacks there.

    Once we recognize that we are on a Mac, we will start looking for fonts in the correct places and all exports will be normal.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  5. #5
    Join Date
    Dec 2007
    Posts
    9

    Default

    Thank you.

  6. #6
    Join Date
    Dec 2007
    Posts
    9

    Default

    I have downloaded last stable build #65 from http://ci.pentaho.org/view/Reporting...port-designer/, but, trying to print on Mac using the new libraries, the problem is still here!

  7. #7
    Join Date
    Feb 2008
    Posts
    7

    Default

    We are also experiencing something that looks very much like this problem. The problem is strictly limited to physical print, which I understood to be the case with original poster too. Exporting to PDF works, but physical print shows up corrupted (whether using a printer or some kind of a pdf exporter as printer).

    The problem is that setting the mrj.version doesn't seem to change the situation. It looks like the mrj.version is used on AbstractFontFileRegisty when registering font pahts to the PDF-FontFactory. Is this registering font path based on the mrj.version hack supposed affect the fonts also on actual printing too?

  8. #8
    skarmali@pentaho.com Guest

    Default

    I have identified that this is a JRE 1.7 issue and not a bug in Reporting. I wrote a simple standalone app that prints a string with different fonts, font size and font attributes like bold. In 1.7, when printing, whatever font is passed to the graphics context is ignored with 1.7 using a totally different font family and font size. I have opened an issue with Oracle about this:

    http://bugs.sun.com/bugdatabase/view...bug_id=9002383.

  9. #9
    Join Date
    Feb 2008
    Posts
    7

    Default

    Quote Originally Posted by skarmali@pentaho.com View Post
    Bumping the thread.... I was never able to find that bug on the database. Any ideas what's up with that?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2017 Pentaho Corporation. All Rights Reserved.