On Tue, 30 Jan 2024 04:44:31 GMT, Prasanta Sadhukhan <psadhuk...@openjdk.org> wrote:
> > Only on Windows platform under certain conditions real device prints > > shifted image on paper. > > Also, if it affects only windows platform, will it not be more advisable to > do in WPrinterJob class instead of RasterPrinterJob? It means that we will need to copy `protected int printPage(Pageable document, int pageIndex)` into 3 classes derived from RasterPrinterJob; namely WPrinterJob , CPrinterJob, PSPrinterJob. I think the most part of RasterPrinterJob code matches all platforms. Would be better to ask somebody who is well familiar with platform dependent print systems. Bug affected windows platform because only WPrinterJob's `getPhysicalPrintableX(Paper p), getPhysicalPrintableY(Paper p)` may return nonzero values. These values may be taken into account separately from this logic int bandX = deviceLeft - deviceAddressableX; if (bandX < 0) { bandGraphics.translate(bandX/xScale,0); bandX = 0; } int bandY = deviceTop + bandTop - deviceAddressableY; if (bandY < 0) { bandGraphics.translate(0,bandY/yScale); bandY = 0; } ------------- PR Comment: https://git.openjdk.org/jdk/pull/17030#issuecomment-1918479199