我试图让我的pdf文档从(0,0)开始,但是看起来文档对象有一个默认的上边距,我不能设置为0.有没有办法做到这一点?
我的代码如下所示
using (MemoryStream memoria = new MemoryStream())
{
Document pdf = new Document(new Rectangle(288, 144));
try
{
PdfWriter writer = PdfWriter.GetInstance(pdf, memoria);
pdf.Open();
pdf.SetMargins(0, 0, 0, 0);
PdfPTable tPrincipal = new PdfPTable(2);
tPrincipal .WidthPercentage = 100;
tPrincipal .DefaultCell.Border = 0;
tPrincipal .TotalWidth = 288f;
tPrincipal .LockedWidth = true;
Run Code Online (Sandbox Code Playgroud)
....
我无法将上边距设置为0.它只是不关心我的设置为(0,0,0,0)并留下上边距(约50f).