简体   繁体   English

如何设置PDF边距?

[英]How to set PDF margin?

Currently I am working PDF generation. 目前,我正在工作PDF生成。 I do not know how to give margin in PDF. 我不知道如何在PDF中提供边距。 I want to set PDF bottom margin 20mm. 我想将PDF底边距设置为20mm。 I am using delivaryTable.SpacingAfter = 10.04f; 我正在使用delivaryTable.SpacingAfter = 10.04f; code

How can I do it? 我该怎么做?

You could set the pdf margins when you instantiate the document object. 实例化文档对象时,可以设置pdf边距。 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);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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