I have a java program, which send jobs to a thermal printer. It prints ok, but it auto cut the paper just after the last image o text without a margin.

How can I set a bottom margin? I have tried printing empty strings or space characters but it it doesn't print it cuts before.

I'm using java.awt.print.

Thanks

Code:
    PrinterJob job = PrinterJob.getPrinterJob();
    job.setPrintable(this);


    PageFormat pf = job.defaultPage();
    Paper paper = pf.getPaper();
    double width = 3 * 72;
    double height = 200000;// * 72;
    double margin = 0;// * 72;
    paper.setSize(width, height);
    paper.setImageableArea(margin, margin, width - (margin * 2), height - (margin * 2));

    pf.setPaper(paper);


    job.setPrintable(this,  pf);

    try {
        job.print();
    } catch (PrinterException ex) {
        return 0;
    }