I am using iTextSharp to create a List<PdfReader> _documents with several PDF documents.
After using merge on this list to create single paged document and send it to the client I see that the PDF looks cut in Adobe Reader.
When I highlight the picture like this I can see it’s there :

and if I save it it will be complete.
If I save one of PdfReader in list as single PDF document – without merge – it looks good.

The merge function is :
public void Merge(Stream outputStream)
{
Document newDocument = null;
try
{
newDocument = new Document();
// Set margins and page size for the document
newDocument.SetMargins(50, 50, 50, 50);
// There are a huge number of possible page sizes, including such sizes as
// EXECUTIVE, LEGAL, LETTER_LANDSCAPE, and NOTE
newDocument.SetPageSize(PageSize.A3 );
PdfWriter pdfWriter = PdfWriter.GetInstance(newDocument, outputStream);
newDocument.Open();
PdfContentByte pdfContentByte = pdfWriter.DirectContent;
if (EnablePagination)
{
_documents.ForEach(delegate(PdfReader doc)
{
_totalPages += doc.NumberOfPages;
});
}
int currentPage = 1;
foreach (PdfReader pdfReader in _documents)
{
for (int page = 1; page <= pdfReader.NumberOfPages; page++)
{
newDocument.NewPage();
PdfImportedPage importedPage = pdfWriter.GetImportedPage(pdfReader, page);
pdfContentByte.AddTemplate(importedPage, 0, 0);
if (EnablePagination)
{
pdfContentByte.BeginText();
pdfContentByte.SetFontAndSize(_baseFont, 9);
pdfContentByte.ShowTextAligned(PdfContentByte.ALIGN_CENTER,
string.Format("{0} of {1}", currentPage++, _totalPages), 520, 5, 0);
pdfContentByte.EndText();
}
}
}
}
finally
{
outputStream.Flush();
if (newDocument != null)
newDocument.Close();
outputStream.Close();
}
}
I suspect it has something to do with newDocument.SetPageSize(PageSize.A3);
but I am not sure and so far I can’t find the solution.
Just a couple of ideas to try. The problem could be related to scaling or sizing. Compare the Horizontal scaling of both documents. Also, the importedPage.PdfDocument.PageSize needs to be compared to the pdfContentByte.PdfDocument.PageSize, and probably scaled down.