Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.4, 5.0.0 alpha1, 5.0
    • Component/s: API, Viewer RI
    • Labels:
      None
    • Environment:
      ICEpdf

      Description


      Problem:
      If I print a document with the print button in the toolbar, the default setting for the printer page is "letter" (the first entry in the ComboBox.
      Is there a possibility to set the format "A4 (ISO/DIN ...) as the default format in the source code when I built the viewer panel?

      The following did not worked:

      The Viewer RI source code there is a class org.icepdf.ri.common.PrintHelper that does most of the lifting for printing. The constructor for this class let the user specify the paper size if needed. The Viewer RI by default set the default paper size to letter as you witnessed. If you want to set the default paper size to A4 there are couple ways to go.
      1. Get the source bundle of ICEpdf.
      2. Go to ./viewer/src/org/icepdf/ri/viewer/res/ICEpdfDefault.properties.
      3. There are comments in this file that give common dimensions in millimeters so the user can change the default paper size. Change those and re-build ICEpdf with Ant. (default target is build.all)

      The following change worked:

      from: MediaSizeName mediaSizeName = loadDefaultPrinterProperties();
      to: MediaSizeName mediaSizeName = MediaSizeName.ISO_A4;

      in the next methods of org.icepdf.ri.common.SwingConroller:

      public void showPrintSetupDialog()
      private void initialisePrinting(final boolean withDialog) { ...


      The customer suggested to implement a method in the SwingController such us
      setDefaultMediaSize(MediaSize mediaSize). Which will allow to perform this operation more easily without further code modifications

        Activity

        Repository Revision Date User Message
        ICEsoft Public SVN Repository #34022 Fri Mar 22 08:25:29 MDT 2013 patrick.corless PDF-477 updated documentation for setting media file size to indicate that it should only be called after the document is loaded.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/viewer/src/org/icepdf/ri/common/SwingController.java
        Commit graph MODIFY /icepdf/trunk/icepdf/viewer/src/org/icepdf/ri/common/PrintHelper.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #33815 Wed Mar 06 18:13:10 MST 2013 patrick.corless PDF-477 added a new method setPrintDefaultMediaSizeName(MediaSizeName mediaSize):void to the SwingController as a convenience method for setting the media size.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-4.3.3/icepdf/viewer/src/org/icepdf/ri/common/SwingController.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #33809 Wed Mar 06 16:39:26 MST 2013 patrick.corless PDF-477 added a new method setPrintDefaultMediaSizeName(MediaSizeName mediaSize):void to the SwingController as a convenience method for setting the media size.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/viewer/src/org/icepdf/ri/common/SwingController.java

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Evgheni Sadovoi
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: