Kieran France Kieran France is a programmer for IDRSolutions in charge of there internal test suite. In his spare time he enjoys tinkering with gadgets and code.

Improving Our Java PDF Printing Examples

1 min read

Java PDF PrintingRecently we have been updating and improving our various JPedal Java PDF Library Support Documentation and examples, during this time I have been improving our print examples. These improvements have been made for several reasons.

  1. The code examples become more uniform with each one working almost identically.
  2. The examples use the most common options and are simpler to access and understand.
  3. The code examples now being cleaner and simpler are good bases to build and make integrating JPedal functionality into your software much easier.

Unfortunately whilst doing this we found some of our existing examples were overly complex and needed to be altered so much that we have instead created a class to replace it. One such example is the SilentPrint example and this is the focus of this article.

With the creation of a new, simpler and easier to use print example SilentPrint was no longer required. As we know that some users may be using this example we have not just removed the class. Instead we have marked it as deprecated in favour of our new print class with a plan to remove SilentPrint at a later date.

Our new print example is called PrintPdfPages and details of the various examples that uses the print functionality can be found here.
This new example is set up and closed in the same manner as our other examples, the methods used to actually print that aren’t found in the other examples are printAllPages(String printerName) and printPage(String printerName, int page).

We understand that there are still users that will wish to handle more complex print tasks, in this case you can either use the new print example as a base to build upon or write your own print code. Writing your own print code is actually easier than it sounds, we even have a tutorial to get you started and a print FAQ that will help you in writing your own print code.

I hope you find the new print examples and the tutorials listed here just a useful if not more so than SilentPrint was before now.

Kieran France Kieran France is a programmer for IDRSolutions in charge of there internal test suite. In his spare time he enjoys tinkering with gadgets and code.

Leave a Reply

Your email address will not be published. Required fields are marked *

IDRsolutions Ltd 2019. All rights reserved.