Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4049865

PrintJob's getPageResoltion or GetPageDimension return incorrect results

XMLWordPrintable

    • 1.1.5
    • generic, x86
    • generic, windows_95, windows_nt
    • Not verified

      On a win95 machine, GetPageResolution is returning 300 but GetPageSize returns
      612x792, which implies that the paper is 2.04 x 2.64 inches instead of 8.5 x 11
      inches.
      ============================================================================
      Using getPageDimension() returns:
      Page Dimensions: 841/595 (WinNT & Solaris)

      The printable area on WinNT is 1050/795
      and on Solaris 841/595

      Using getPageResolution () returns:
      600 (WinNT), 72 (Solaris)

      Both are using the same printer:
      HP LaserJet 4/4M Plus PS 600

      Solaris is print to a PostScript printer.
      ====================================================================

      Additional information from Netiva:

      > Bug fix 3: PrintJob.getPageDimension() has problems.
      > a) Documentation says this Dimension is in pixel values. This is
      > incorrect the value returned is in points (72 dpi).
      > b) Code in AwtGraphics::StartPrintJob() does not retrieve page size
      > information correctly. There are extensive comments around our fix which
      > starts at line 964 of the attached file. Basically using DEVMODE
      > dmPaperWidth and Length is not a reliable way to get the size of a page.
      > The generally accepted way to do this is to use GetDeviceCaps as outlined
      > in the attached code.
      > c) Using the DEVMODE structure for getPageDimension() yields erroneous
      > results when the user selects landscape orientation. The values are for
      > portrait mode regardless of what the user selects. Using GetDeviceCaps()
      > does not suffer from this problem; it reflects the orientation that the
      > user selects in the print dialog box.

            jkoenigsunw Janet Koenig (Inactive)
            tonywyant Tony Wyant (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: