Hi all,
I have a PDF in a custom format (< A4), which I am trying to print. While
printing works fine itself I am not able to move the output - which is a
necessity.
No here is what I do, please let me know where I go wrong.
doc = PDDocument.load(location);
printJob = PrinterJob.getPrinterJob();
pageFormat = printJob.defaultPage();
// Initialize
paper paper = new Paper();
// A4
paper.setSize(594.992125984252, 841.8897637795276);
// Set the margins.
paper.setImageableArea(200, 200, 500, 500);
pageFormat.setPaper(paper);
printJob.setPrintable(doc.getPrintable(0), pageFormat);
try {
doc.silentPrint(printJob);
} catch (PrinterException e) {
e.printStackTrace();
}
No matter what I do, the pdf is alwas printed top left.
Thanks in advance!
Kai