You might try the approach shown here. Use drawImage()
instead of drawString()
in your Image
printable.
private static class Image implements Printable {…}
private static class Title implements Printable {…}
PrinterJob pj = PrinterJob.getPrinterJob();
Book book = new Book();
book.append(new Image(), pj.defaultPage());
book.append(new Title(), pj.defaultPage());
book.append(table.getPrintable(...), pj.defaultPage());
book.append(new EndPage(), pj.defaultPage());
pj.setPageable(book);
pj.print();
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…