Hi All!
I'm new in BDFBox.
I try to print one page to specified tray, but it is make an endless
printing loop. I do something wrong or it is a bug in the library?
My source code is:
PDDocument pdf =
PDDocument.load("c:\\Java\\nb74_projects\\lpu\\AISB08.pdf");
PrintService[] ps = PrinterJob.lookupPrintServices();
for (int x=1; x<ps.length; x++) {
System.out.println(ps[x].getName());
if (ps[x].getName().compareTo("Canon Generic PCL6
Driver")==0) {
PrinterJob pj = PrinterJob.getPrinterJob();
pj.setPrintService(ps[x]);
PrintRequestAttributeSet pset = new
HashPrintRequestAttributeSet();
pset.add(MediaTray.TOP);
pj.setPrintable(pdf.getPrintable(0));
pj.print(pset);
}
}
Big thanks for any help!
Stephen Gyenes