Tengo un visor de mapas que fue desarrollado utilizando el SDK Java de ArcGIS Runtime. Estoy tratando de hacer un botón de impresión y funciona con un problema. Parece que no puedo averiguar cómo hacer que quepa en una página.
private void printMap() {
Paper paper = new Paper();
// ...set up the paper options...
PrinterJob printJob1 = PrinterJob.getPrinterJob();
PageFormat pageFormat = new PageFormat();
HashPrintRequestAttributeSet set = new HashPrintRequestAttributeSet();
if (printJob1.printDialog(set)) {
try {printJob1.print(set);}
catch (PrinterException exc) {
// System.out.println(exc);
}
}
//set up page format [DEFAULT] options and pass the paper settings through
pageFormat.setPaper(paper);
// set page format for the map to print
map.setPageFormat(pageFormat);
printJob1.setPageable(map);
try {
// send job to printer!
printJob1.print();
// new PrintMe().print(YourJTextComponent);
} catch (PrinterException e) {
// handle the exception
}
}
Estoy usando Eclipse Kepler SR1, la resolución es 1920x1080. ¿Alguna idea o sugerencia?
Así es como se imprime