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

        Hide
        Stefan Knoefel added a comment -

        priority is Minor

        Show
        Stefan Knoefel added a comment - priority is Minor
        Hide
        Patrick Corless added a comment -

        Thanks Stefan;

        The patch looks good.

        Any change I could get you to sign a contributors agreement? http://www.icepdf.org/community/contribute.html.

        Show
        Patrick Corless added a comment - Thanks Stefan; The patch looks good. Any change I could get you to sign a contributors agreement? http://www.icepdf.org/community/contribute.html .
        Hide
        Stefan Knoefel added a comment -

        Hi Patrick,

        I think this can wait until I contribute something with more than two lines of code

        Show
        Stefan Knoefel added a comment - Hi Patrick, I think this can wait until I contribute something with more than two lines of code
        Hide
        Patrick Corless added a comment -

        All right thanks Stefan.

        Updated the getSetupDialog() as suggest to keep the dialog window in the same monitor as the viewer. The headless printer crowd shouldn't be affect by this change...

        Show
        Patrick Corless added a comment - All right thanks Stefan. Updated the getSetupDialog() as suggest to keep the dialog window in the same monitor as the viewer. The headless printer crowd shouldn't be affect by this change...

          People

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

            Dates

            • Created:
              Updated:
              Resolved: