3

I have PDF letterhead with a header and a footer. I have to print my reports on this "electronic letterhead". How can I do this? Do I need to use any third party libraries? Is there a more appropriate approach (instead of modifying existing PDF) to achieve this?

1 Answer 1

2

If all you have is the PDF, do this:

  1. Convert the PDF to an image.
  2. Split the header and footer into two images.
  3. Place the images on the Background Band.

There are a few ways to convert the image, and some details:

  • Use a high-resolution (600 dpi) version of the image.
  • Use ImageMagick to automate the process.
  • Split the image in half, then trim both halves.
  • Use PNG format (not JPEG) for highest quality results.

This way you do not have to modify the PDF. The PDF remains the master and the images get included by JasperReports.

Not the answer you're looking for? Browse other questions tagged or ask your own question.