直接打印还是用zplii打印的?

解决方案 »

  1.   

    最好是直接打印。
    附我现在的源码:
    Dimension si = printFrame.printPanel.getSize();
    BufferedImage bi = new BufferedImage(si.width, si.height, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = bi.createGraphics();
    printFrame.printPanel.paint(g);
    g.dispose();然后经过什么样的图片处理打印出来?
    我是直接打印界面的,获得的DPI是96,打印默认是72的,(图片大小界面和实物是一模一样的)怎么提高精度,并一模一样打印出来?
      

  2.   

    Image image = bi.getScaledInstance(
    (int)(bi_width * 72/96), 
    (int)(bi_height * 72/96), Image.SCALE_DEFAULT); 

    BufferedImage bi2 = new BufferedImage((int)(bi_width * 72/96), (int)(bi_height * 72/96), BufferedImage.TYPE_INT_RGB);
    Graphics2D g2 = bi2.createGraphics();
    g2.drawImage(image, 0, 0, null); // 绘制缩小后的图   
     g2.dispose();
    执行图片压缩后,打印出来大小是一样了,就是字体很模糊,怎么提高精度?