ICEpdf
  1. ICEpdf
  2. PDF-264

PrintDialog appears on wrong screen in multi-screen environment

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.1.4
    • Fix Version/s: 4.2
    • Component/s: Viewer RI
    • Labels:
      None
    • Environment:
      windows XP
      jdk1.6.0_24

      Description

      When running the PDF viewing application on a machine with multiple display devices (monitors),
      the print dialog may be shown on the wrong screen when the print button is pressed.
      Wrong means that the dialog is not on the same screen as the Window containing the viewer.

      Cause is located in class org.icepdf.ri.common.PrintHelper in method
      <code>
      private PrintService getSetupDialog()
      </code>

      the patch below should handle the screens correctly:

      <code>
          private PrintService getSetupDialog() {
              final int offset = 50;
              Window window = SwingUtilities.getWindowAncestor(viewController.getViewContainer());
              GraphicsConfiguration graphicsConfiguration = window == null ? null : window.getGraphicsConfiguration();
              return ServiceUI.printDialog(graphicsConfiguration,
                      viewController.getViewContainer().getX() + offset,
                      viewController.getViewContainer().getY() + offset,
                      services, services[0],
                      DocFlavor.SERVICE_FORMATTED.PRINTABLE,
                      printRequestAttributeSet);
          }
      </code>

        Activity

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Stefan Knoefel
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: