0 Replies Latest reply on Nov 25, 2009 11:07 PM by Dave Chen

    Java printing: can not print Chinese characters inside Jboss

    Dave Chen Master

      We are running JBoss 5.1.0GA on FC 10, and have java printing code.

      From command line on the same machine, the following code works and print chinese characters on the printer correctly.

      public int print(Graphics g, PageFormat pf, int pageIndex) throws PrinterException {
      if (pageIndex > 0) {
      return NO_SUCH_PAGE;
      }

      Graphics2D g2d = (Graphics2D)g;

      g2d.translate(pf.getImageableX(), pf.getImageableY());

      Font font = new Font("Serif", Font.PLAIN, 10);
      g.setFont(font);

      g.drawString("some chinese characters", 0, 20);


      return PAGE_EXISTS;
      }

      but the same code inside Jboss, the chinese characters are printed as small boxes. It seems it does not have the font. However the code works running from command line.

      Is there anything Jboss related to fonts? or printing?

      Thanks,
      Dave