Manipulating existing PDFs (iText 5)

In this chapter, we're going to solve some problems when working with existing PDFs that need to be split into different files, merged or stamped. Usually, we are going to use a combination of PdfReader to read the document and PdfStamper, PdfCopy or PdfSmartCopy to create a new PDF. Note that we'll skip filling out interactive forms for now. We'll deal with AcroForm and XFA technology in the next chapter.

Would you like to have these reference answers available to you at any time? Consider downloading the entire book 'The Best iText Questions on StackOverflow' for free!

I need a variation on the example given in answer to the following question: How to convert an existing A4 PDF document to an A3 booklet? I have more or less the same requirement, but I don't want the consecutive pages to appear side by side on the same page. I want page 4 and 1 on one page and page 2 and 3 on another page. So, when I print these pages on a single sheet of paper, I can fold that paper into a booklet with page 2 on the back of page 1 and page 4 on the back of page 3.
I want to convert an existing A4 PDF document into an A3 PDF using Java (a booklet of the original PDF).
I know that iText can generate tagged PDF documents from scratch, but is it possible to insert alternative text for images in an existing tagged PDF without changing anything else?
I need to add existing pages from different PDFs under an existing page in another PDF.
I am tiling a document as is done in the TilingHero example. That works well, but now I'd also like to add margins to each page.
I am stamping text on an existing PDF document. This works for all PDFs, except for PDFs with forms. When I open a document after adding text, I get a lengthy error message about reader extensions.
I am trying to use a PDF for stamping and need to rotate it 90 degrees to lay it on correctly?
I need to scale down the pages of an existing PDF document. This works fine if the pages aren't rotated, but I don't succeed in rotating pages correctly,
I am using PdfWriter , PdfImportedPage and the addTemplate() method to shrink pages. However, when I do so, I lose the rotation of the pages and I lose all interactive features.
All the examples I've found seem to involve adding metadata while creating a new Document . I want to take an existing PDF and add a GUID to each page's XMP using the stamper.