PDF Merge

Help
Michael
2008-01-31
2013-05-28
  • Michael
    Michael
    2008-01-31

    Hello,

    am I able to merge two PDF documents with jPod?

    Thanks a lot
    Michael

     
    • Michael
      Michael
      2008-01-31

      Hello,

      to explain a bit more what I want to do. I have two pdf documents. Each contains one page. I want to render the page of the second document on top of the page of the first document.

      Thanks a lot
      Michael

       
    • mtraut
      mtraut
      2008-01-31

      ...this is exactly what the example "Overlay" does....

      you may encounter some specialties, but the concept should be the same.

      Common issue: ensure the page you use for overlay is transparent!

       
    • Suhail Saleem
      Suhail Saleem
      2008-09-08

      does this mean u will not be able to overlay a picture over text, and be able to read it?i tried this using the "overlay" in the example and my text was hidden.

      thanks
      suhail

       
    • Suhail Saleem
      Suhail Saleem
      2008-09-08

      hi.

      to make this a little more clear, suppose i use the DrawShape output from the example and overlay it over a text document, is there no way i can make the text go over the smiley face?

      thanks
      suhail

       
      • mtraut
        mtraut
        2008-09-08

        There should be no problem doing this.

        In a "watermark" scenario you must simply take care that the content or form you draw upon a page has no solid background. Such a background (big white rectangle) is created by lots of applications.

        Such a background is not created by "DrawShape", so i see no problems. Let me know if you encounter some.

        B.t.w., formally, if you draw the smiley OVER the page (as in the example), the text may never go "over" the face, this means the smiley lines will hide the text lines. Only where there is no smiley the old page lurks through. You will see this if you make the lines wider and draw for example in red. But you can put the smiley behind the old page, for example by using "cosPrependContents" instead of "cosAddContents".

         
    • Suhail Saleem
      Suhail Saleem
      2008-09-09

      Thanks mtraut, you're a genius! :) cosPrependContents did the trick!another question btw...now what if i want to put an image (jpeg) instead of the smiley face?i tried going through the documentation but could not find anything that explained how to put an image on a pdf file or what classes to use..if you could probably give me an example code or explain how to go about it...

      Thanks a lot!
      (newbie) Suhail :)

       
      • mtraut
        mtraut
        2008-09-09

        ok - so far nobody has noticed this, but i totally agree :-)

        for adding images there are two scenarios:

        - you have a PDF template already containing the page with the image. You can deal with this case in the same way as in the overlay example, should work.

        - you have an external image. converting images from platform formats to PDF is implemented in jPodRenderer libraries, as this depends on AWT (or SWT code). Conversion may be done using "de.intarsys.pdf.platform.cwt.image.awt.ImageConverterAwt2Pdf". You find the "jPodRenderer" project on sourceforge as well. Examples for embedding images are planned, but not yet released. Please note the GPL license for jPodRenderer (as opposed to BSD for jPod).