You can set the size of the document and affect the following pages. Some snippets:
Set up your document somewhere (you know this already):
var document = new Document();
PdfWriter pdfWriter = PdfWriter.GetInstance(
document, new FileStream(destinationFile, FileMode.Create)
);
pdfWriter.SetFullCompression();
pdfWriter.StrictImageSequence = true;
pdfWriter.SetLinearPageMode();
Now let's move on to your pages (maybe you will do it too) and decide what page size you want on the page:
for (int pageIndex = 1; pageIndex <= pageCount; pageIndex++) {
document.SetPageSize(new Rectangle(600, 800));
if (document.IsOpen()) {
document.NewPage();
} else {
document.Open();
}
}
source
share