Recently 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.
- The code examples become more uniform with each one working almost identically.
- The examples use the most common options and are simpler to access and understand.
- 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.
IDRsolutions develop a Java PDF library, a PDF forms to HTML5 converter, a PDF to HTML5 or SVG converter and a Java Image Library that doubles as an ImageIO replacement. On the blog our team post about anything interesting they learn about.