无边打印图片

        // Set the margins to zero for borderless printing
        Paper paper = new Paper();
        paper.setImageableArea(0, 0, paper.getWidth(), paper.getHeight());
        pageFormat.setPaper(paper);

        printerJob.setPrintable(new ImagePrintable(printerJob, image), pageFormat);
        printerJob.setPrintService(printServices[0]);  // you may need to select a proper print service

你可能感兴趣的:(java)