Please choose a menu option

RSS feed? News:

19 Aug 10 Version 4.36 build 60 released JPedal can now read PDF's aloud using the Freetts library, improvements to signing and mouse functions, enhancements to Font and Javascript engines. More Info...

29 Jul 10 JPedal Java ME Viewer Now released and available under an LGPL licence More Info...

12 Jul 10 Version 4.30 build 16 released Enhanced Print dialog, Control via Javascript and Applet enhancements Read More ...

10 Jun 10 Version 4.21 build 56 released Major speed improvements to viewer and general parsing speed. Read More ...

10 Jun 10 JBig 2 image decoder Version 2 released Major Upgrade to JBig2 image decoder - 3-5 times faster. Read More ...

03 Jun 10 Version 4.20 build 21 released Major Upgrade to TrueType font engine supporting Chinese fonts, speed improvements. Read More ...

22 Apr 10 EBook reader encryption Pjes now handles encrypted PDFs - upload an Encrypted PDF, and everyone will need the password to open it.
Ebook reader...

19 Mar 10 Version 4.10 build 16 released First implementation of JPedal in JavaME, support for linearization of PDFs, Coons and Tensor shading support.Read More ...

04 Feb 10 Major new version New look, new page turning mode, enhanced search, code tidy up and much more...

23 Sep 09 PDF Java Ebook Solution IDRsolutions is pleased to announce a new free service which embeds PDFs inside our viewer. A must for e-book authors and distributors. Read More ...

Draw additional objects in SimpleViewer

Sometimes you may wish to overlay a display page with additional text or annotations (for example a copyright notice) but not have them as part of the PDF. Because JPedal provides a standard JPanel component you can manipulate it directly - the advantage of this method is JPedal takes care of all scaling and rendering issues.

Adding objects to a displayed page

The method org.jpedal.PdfDecoder.drawAdditionalObjectsOverPage(...) makes this possible. This function is best explained with example code, so there is a documented example in org.jpedal.examples.simpleviewer.gui.SwingGUI. This is a good starting point for experimenting with this feature.

If you wish to print across a page range, this really needs to be setup first. For this reason, PDF printing is handled separately. The method org.jpedal.PdfDecoder.printAdditionalObjectsOverPage(...) makes this possible. This function is best explained with example code, so there is a documented example in org.jpedal.examples.simpleviewer.gui.SwingGUI, below the draw code.

Removing objects from a displayed page

The method org.jpedal.PdfDecoder.flushAdditionalObjectsOnPage() makes this possible. This function is best explained with example code, so there is a documented example in org.jpedal.examples.simpleviewer.gui.SwingGUI. This feature is avalible from 3.45b32.

Custom objects

You can also add custom objects which implement the interface org.jpedal.external.JPedalCustomDrawObject
to give you total control over drawing. It also includes methods to control visibility and a separate method for printing. An inner class example is located here.

Note: In certain cases a PDF file can have a clip set on it, in which case some custom objects may not be visible. We suggest setting the clip to null before any additional objects are drawn.

Important note on PDF printing

You can either create separate objects for each page or create a global set for all pages. This is done by using printAdditionalObjectsOverAllPages() method. For an example click here

 

Return to main PDF support section

Click here for the main PDF support area with lots of java examples, PDF tutorials and useful information to get the most out of the JPedal PDF library

 


PDF viewer