-1

I am trying to do overlay using org/apache/pdfbox/util/Overlay, any idea on how to use it. It has got setter methods for source doc and overlay doc but what are the input parameters for the overlay method? Any working example would be of great help.

I did try to look into the examples in the source zip, but there aren't any for Overlay.

OKOK
  • 259
  • 2
  • 16
  • 1
    You mean other than the examples you get when you type "pdfbox overlay example" into google? http://stackoverflow.com/questions/8929954/watermarking-with-pdfbox – Gimby Nov 10 '15 at 12:08
  • That question makes use of org.apache.pdfbox.Overlay and not the "util" overlay. My question is more specific to usage of "util" overlay, the api docs are not clear enough. – OKOK Nov 10 '15 at 12:54
  • fair enough, you might detail that a little clearer in your question. Given that there is absolutely zero code to be find which demonstrates its usage, that sends a clear signal to me that you shouldn't be using it. What exactly could util.Overlay do for you that the widely documented pdfbox.Overlay cannot? – Gimby Nov 10 '15 at 13:28
  • I found its usage, in the pdfbox source code but not in the examples directory, instead in the source code of another class called OverlayPDF. – OKOK Nov 10 '15 at 13:44
  • That does not answer my question. Basically you don't know and you're trying to figure out what it does? – Gimby Nov 10 '15 at 14:03
  • Yes, and to figure it out I needed a working example, hence I posted the question. Secondly, now I know a bit more of what it does, if you use org.apache.pdfbox.Overlay you have to ensure that the two documents which are being overlayed have got exactly the same number of pages. With "util" overlay you can overlay the single page on multiple pages of the source document and also select different page for even and odd pages. I hope now I have answered your question. As a side note, if something is not used that does not mean that it should not be explored, now I know that it is useful for me. – OKOK Nov 11 '15 at 10:39
  • I modified the answer referred here to use util package's Overlay. http://stackoverflow.com/questions/8929954/watermarking-with-pdfbox/9382212#9382212 – Droidman Feb 03 '16 at 22:20

1 Answers1

0

Please check OverlayPDF class within apache pdfbox source code.

OKOK
  • 259
  • 2
  • 16