I am currently working on a Point Of Sale system and am having a hard time w/ the receipt layout. I can not get the paper height to work. It always cuts off at 11 inches or so. I also am making changes to the paper width and margins which work fine. here is the code that I define the paper and pageformat. I'd appreciate any help on this.
public void Printer()
{
PrinterJob pj = PrinterJob.getPrinterJob();
Paper paper = new Paper();
PageFormat fmt = new PageFormat();
paper.setSize(200,2400);
paper.setImageableArea(10,10,180,2380);
fmt.setPaper(paper);
pj.setPrintable(this, fmt);
PrintService[] services = PrinterJob.lookupPrintServices();
PrintService ps = null;
for (int i=0; i<services.length; i++)
{
// System.out.println("Selected Printer: " + services.getName());
String sPrinterName = services[i].getName();
if (sPrinterName.startsWith(recpt.sHostRecptPrinterName))
{
ps = services[i];
System.out.println("Found receipt Printer: " + services[i].getName());
}
}
try
{
pj.setCopies(1);
pj.setPrintService(ps);
pj.print();
}
catch (PrinterException pe)
{
System.out.println(pe);
}
}