ICEpdf
  1. ICEpdf
  2. PDF-125

minor bug in PrintServices example

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.2
    • Fix Version/s: 4.0
    • Component/s: Examples
    • Labels:
      None
    • Environment:
      LINUX: 2.6.31-15-generic #50-Ubuntu SMP Tue Nov 10 14:54:29 UTC 2009 i686 GNU/Linux
      Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
    • Workaround Exists:
      Yes
    • Workaround Description:
      modify example as described above

      Description

      On Line 97 of PrintServices.java there is a for loop which lists the users printers:

      for (int i = 0, max = services.length - 1; i < max; i++) {

      If the user has only a single printer (as I do on my Ubuntu system) then no printers are listed.

      Instead of testing for "i < max" the test should be "i <= max"

      for (int i = 0, max = services.length - 1; i <= max; i++) {

      At the same time for clarity it may also be worth changing the user prompt on line 99 to include "printer number" :

                          "Please select the printer number your wish to print to (q to quit):");

      Regards

      Alec Cormack

      p.s. ICEpdf is great software. Many thanks!

        Activity

        Hide
        Patrick Corless added a comment -

        Nice catch Alec;

        Can you take a look at our contributors aggrement at http://www.icepdf.org/community/contribute.html and fax or email it to ICEsoft? Many thanks.

        Patrick

        Show
        Patrick Corless added a comment - Nice catch Alec; Can you take a look at our contributors aggrement at http://www.icepdf.org/community/contribute.html and fax or email it to ICEsoft? Many thanks. Patrick
        Hide
        Patrick Corless added a comment -

        I've given the PrintService and the PrintHelp a one over to try and make them easier to use and more customizable. The PrinterServices example now uses the PrintHelper class to help with printing. I've updated the PrintHelper class has been updated to be more configurable, both the constructor and setupPrintService have been updated.

        Show
        Patrick Corless added a comment - I've given the PrintService and the PrintHelp a one over to try and make them easier to use and more customizable. The PrinterServices example now uses the PrintHelper class to help with printing. I've updated the PrintHelper class has been updated to be more configurable, both the constructor and setupPrintService have been updated.
        Hide
        Alec Cormack added a comment -

        Thanks for the update Patrick and the quick fix. Is the new code available via svn yet please? I had a quick search at http://anonsvn.icefaces.org/repo/icepdf/tags/icepdf-4.0.0-Beta2/ but couldn't see it.

        Alec

        Show
        Alec Cormack added a comment - Thanks for the update Patrick and the quick fix. Is the new code available via svn yet please? I had a quick search at http://anonsvn.icefaces.org/repo/icepdf/tags/icepdf-4.0.0-Beta2/ but couldn't see it. Alec
        Hide
        Patrick Corless added a comment -

        You can get the updated example and print helper off the trunk right now. I'll be updating the 4.0 tag today but you won't be able to see it for another 24 hours unfortunately.

        Show
        Patrick Corless added a comment - You can get the updated example and print helper off the trunk right now. I'll be updating the 4.0 tag today but you won't be able to see it for another 24 hours unfortunately.

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Alec Cormack
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: