@Override
	    public int print(Graphics graphics, PageFormat pageFormat,
	                                     int pageIndex) throws PrinterException {
	        System.out.println(pageIndex);
	        int result = NO_SUCH_PAGE;
	        if (pageIndex < 1) {
	            Graphics2D g2d = (Graphics2D) graphics;
	            System.out.println("[Print] " + dump(pageFormat));
	            double width = pageFormat.getImageableWidth();
	            double height = pageFormat.getImageableHeight();
	
	            System.out.println("Print Size = " + fromPPItoCM(width) + "x" + fromPPItoCM(height));
	            g2d.translate((int) pageFormat.getImageableX()-20,
	                            (int) pageFormat.getImageableY()+75);
	            Image scaled = null;
	            if (width > height) {
	                scaled = image.getScaledInstance((int)Math.round(width), -1, Image.SCALE_SMOOTH);
	            } else {
	                scaled = image.getScaledInstance(-1, (int)Math.round(height), Image.SCALE_SMOOTH);
	            }
	            g2d.drawImage(scaled, 0, 0, null);
	            result = PAGE_EXISTS;
	        }
	        return result;
	    }