我m new here and have a Problem with PDFBox.
I
试图打印单个PDF文档,但它没有t work so far.
I found some examples in the internet, but don
让它运行,所以我希望这里的某个人有一个想法,我的mystake在哪里。
我到目前为止的守则是:
File datei = new File("D:\\161413070_00-76-150-1803_FIP_170109.pdf");
if(datei.exists())
{
try(PDDocument doc = PDDocument.load(datei)) {
PrinterJob job = PrinterJob.getPrinterJob();
job.setPageable(new PDFPageable(doc));
if(job.printDialog())
{
job.print();
}
doc.close();
}catch(InvalidPasswordException ivpwe)
{
Logger.getLogger(WinScanJ.class.getName()).log(Level.SEVERE, null, ivpwe);
}
catch(IOException | PrinterException ioe)
{
Logger.getLogger(WinScanJ.class.getName()).log(Level.SEVERE, null, ioe);
}
}
程序正在打开打印对话框,这很好,似乎发出了打印作业。我可以在Windows中的打印队列中看到打印作业大约一秒钟,但打印机不知道原因t printing something.
I have a network printer here and it works fine.
I guess my program is sending an empty print advice, but don
。指定的PDF文档存在且不为空。
有谁知道问题可能是什么?
感谢您的建议 TDO