< prev index next >
src/java.desktop/share/classes/sun/print/RasterPrinterJob.java
Print this page
*** 681,691 ****
float ix = (float)(page.getPaper().getImageableX()/DPI);
float iw = (float)(page.getPaper().getImageableWidth()/DPI);
float iy = (float)(page.getPaper().getImageableY()/DPI);
float ih = (float)(page.getPaper().getImageableHeight()/DPI);
! if (ix < 0) ix = 0f; if (iy < 0) iy = 0f;
try {
pageAttributes.add(new MediaPrintableArea(ix, iy, iw, ih,
MediaPrintableArea.INCH));
} catch (IllegalArgumentException iae) {
}
--- 681,705 ----
float ix = (float)(page.getPaper().getImageableX()/DPI);
float iw = (float)(page.getPaper().getImageableWidth()/DPI);
float iy = (float)(page.getPaper().getImageableY()/DPI);
float ih = (float)(page.getPaper().getImageableHeight()/DPI);
!
! if (ix < 0) ix = 0; if (iy < 0) iy = 0;
! if (iw <= 0) iw = (float)(page.getPaper().getWidth()/DPI) - (ix*2);
!
! // If iw is still negative, it means ix is too large to print
! // anything inside printable area if we have to leave the same margin
! // in the right side of paper so we go back to default mpa values
! if (iw < 0) iw = 0;
!
! if (ih <= 0) ih = (float)(page.getPaper().getHeight()/DPI) - (iy*2);
!
! // If ih is still negative, it means iy is too large to print
! // anything inside printable area if we have to leave the same margin
! // in the bottom side of paper so we go back to default mpa values
! if (ih < 0) ih = 0;
try {
pageAttributes.add(new MediaPrintableArea(ix, iy, iw, ih,
MediaPrintableArea.INCH));
} catch (IllegalArgumentException iae) {
}
< prev index next >