Accepted answer

the most recent plugin about printing and printing preview is:


a simple, light weight, extensible java printing plug-in for swt.
paperclips hides the complexity of laying out and rendering documents on the printer, helping you focus on what to print instead of how to print it.

in a nutshell, paperclips provides an assortment of document "building blocks," which you can tweak and combine to form a custom document.
the assembled document is then sent to paperclips for printing.
paperclips includes support for printing text, images, borders, headers and footers, column layouts and grid layouts, to name a few. it can also be extended with your own printable classes.

here in an example in this article:

alt text


eclipse does a terrible job printing on windows. but there is an excellent version of enscript that works for windows and does great printouts. you have to set it up as an external tool which is a bit of a bear, but once it's setup it works well.this how i installed it on xp.

  1. download and install enscript for windows

  2. create an external tool for running enscript in eclipse

    goto eclipse, run -> configure external tools.
    add a tool (icon looks lie a miniature document with +)
    name it "run enscript". configure as follows:

    • main tab
      location : browse to the enscript executable. should be in:
      c:\program files\gnuwin32\bin\enscript.exe
      working directory: leave empty
      arguments: --header=${resource_name} -p "${workspace_loc}\${project_name}\" "${resource_loc}"
      (these options will create a postscript file named at the top level of your project from the currently selected window.)

    • build tab
      clear "build before launch" or it will try to rebuild your project each time you print..

  3. send the file to the printer

    you need to find a way to send the file to the printer. several utilities to do that, but since i had a postscript capable printer all i had to do is to share it under windows, and copy the file to the share name. i automated this by adding another external tool, named "send ps file to printer"

    • main tab
      location: c:\windows\system32\cmd.exe
      working directory: leave empty
      arguments: /c copy "${workspace_loc}\${project_name}\" \\your-machine-name-here\your-printer-share-name-here
      (this will pick up the file we just created and send it to the printer)
    • build tab
      clear "build before launch"

voila, two clicks to run the tools one after the other and it prints clean. you can configure it further by adding enscript options to the argument line. here are a few useful ones:
- specify a slightly smaller font size (default is 10): -f courier8
- truncate lines instead of wrapping: -c
- precede line with its line number: -c

Related Query

More Query from same tag