i'm having some trouble while printing Barbecue Barcodes when the page format is in Landscape. Any would know why? When the page is Portrait, the barcode is printed correctly, but in Landscape the code will appear blurry.
PrinterJob job = PrinterJob.getPrinterJob();
PageFormat pf = job.defaultPage();
pf.setOrientation(PageFormat.LANDSCAPE);
job.setPrintable(this,pf);
boolean ok = job.printDialog();
if (ok) {
try {
job.print();
} catch (PrinterException ex) {
/* The job did not successfully complete */
}
}
The way I generate the barcode is the following: code is a String with random numbers and letters.
Barcode b = BarcodeFactory.createCode128(code);
Font font = new Font("Serif", Font.PLAIN, 10);
b.setFont(font);
b.setBarWidth(1);
b.setBarHeight(20);