当我使用Java(使用wkhtmltopdf生成)打印PDF文件时,文本全部损坏。
示例输出如下所示, http://i.imgur.com/CZkNczy.png
我制作PDF文件的代码,
/usr/local/bin/wkhtmltopdf --page-width 72 --page-height 200 --margin-top 0 --margin-right 0 --margin-bottom 0 --margin-left 0 --encoding 'utf-8' [full_path_html] [full_path_pdf]
我打印PDF的代码,
PrintService service = ServiceUI.printDialog(null, 50, 50, services, null, flavor, atts);
final PrinterJob job = PrinterJob.getPrinterJob();
job.setPrintService(service);
PDDocument document = PDDocument.load([full_path_pdf]);
document.print(job);
document.close();