All the examples I can find seem to assume you are merging existing PDFs, and in particular sticking a bunch of PDFs at the end of another PDF.
In my situation I am generating something analogous to a bibliography but if the reference is to a file of PDF format, they want the contents of that PDF inserted inline, immediately after the citation, not out of place at the end of the file.
Note that there is no guarantee that the external PDFs use the same page size, rotation, etc, as the PDF document I'm generating.
Is there a way to do this? I've tried modifying the itext example on how NOT to do this (with a PdfWriter) but I get an unbalanced save/restore state message. I'm also considering doing this by post-processing as all the examples do, but I'm not quite sure how I'd go about looping through the bibliography PDF and determining where to insert the pages of the external PDFs.
Thanks.