Forum How do I...?

Merge two PDFs into one?

Anonymous
Testing princexml, love it about to buy it need one more thing: merging. Can I take the output I create and merge an already-generated PDF and output to a new file?

Thanks,
Hans
Ben
I am also interested in this functionality. It would be very useful to generate a pdf from xml with Prince, and insert automatically a pdf file onto a page. This would be tricky, because it would have to take into account pagination, so I'm not sure what the best solution would be.
My application would be:
Generating some document of, say, 100 pages. On page 60, I already have a "page" I would like to use, generated with some other application.
Currently, I do one of two things:
1) in the xml at this point I use a tag to make a blank page break, and then manually insert the page in acrobat, and remove the blank page (necessary to keep the pagination consistent, otherwise the new page isn't counted).
2) convert the page itself to a "jpg" and insert it like a graphic onto the blank page, assuming all is sized correctly. (this way works better, as I can size the graphic to the dimensions of the page, minus the margins, and still have a page number shown).
I am not sure what the best solution would be, as obviously it is not possible to re-paginate already generated pdf files.
Anonymous
Me too!

I have:

<object data="myotherdoc.pdf"
                     type="application/pdf"
                     width="800"
                     height="600">
           <a href="myotherdoc.pdf">My Other Doc (PDF)</a>
</object>

This embeds an Acrobat viewer when viewed online (IE and Firefox, not Opera, dunno about Safari). And Prince generates the link to the PDF after complaining, ".\My Other Doc.pdf: warning Unkonwn image format."

So this gives me a degraded PDF that can be viewed online, but is no use for printing.

My vote is for embedded PDF using the object tag instead of img, since I don't want the image, I want the object. :?

And param tags inside the object could be used for width and height in inches or points?
mikeday
There are two ways we could embed PDF documents in the PDF output:

(1) Take the first page of the PDF and embed it as if it were an image. This method allows you to use PDF as a format for storing vector graphics, diagrams, maps, charts and so forth.

(2) Take all the pages of the PDF and embed them inbetween the existing pages of the current output. This method allows you to take chapters or sections stored in external PDF files and splice them in to your output PDF.

Since you describe specifying a width/height for the object, it seems that you are referring to the first method, is that correct?
ccvqc
No, actually I personally much prefer just being able to insert whole pages. I just wanted to be sure they matched the page size of the rest of the document in case there was a discrepancy.
Anonymous
If you're using a Mac, you can use Automator to combine pdf files.
Anonymous
And if you own Acrobat, you can construct a PDF out of multiple PDFs.
grahamrobbins
Great product, soon to buy, but would be very handy to have option 1 - embed the pdf as if it were an image - has their been any progress?

I couldn't see any more detail in the current documentation.
mikeday
Prince does not support embedding PDF files as images yet; for now I'm afraid you will need to make do with bitmap images like JPEG or PNG, or XML vector graphics with SVG. :)