Azhar
Azhar

Reputation: 31

How to set PDF margin?

Currently I am working PDF generation. I do not know how to give margin in PDF. I want to set PDF bottom margin 20mm. I am using delivaryTable.SpacingAfter = 10.04f; code

How can I do it?

Upvotes: 1

Views: 9693

Answers (1)

You could set the pdf margins when you instantiate the document object. Here's the syntax constructor:

public Document(
Rectangle pageSize,
float marginLeft,
float marginRight,
float marginTop,
float marginBottom)

Here's a usage example:

Document doc = new Document(PageSize.A4, 20, 20, 20, 20);

Upvotes: 5

Related Questions