简体   繁体   中英

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?

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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM