如何在PDF中绘制一个大的形状,并使其跨越多个页面

时间:2015-12-03 20:45:36

标签: itextsharp

我正在使用非常大的iTextSharp绘制一个形状。如何使形状跨越多个页面?

string pdfpath = Server.MapPath("PDFs");        
Document doc = new Document();  
doc.NewPage();  
doc.AddTitle("");
doc.AddAuthor("");       
PdfWriter writer = PdfWriter.GetInstance(doc, new FileStream(pdfpath + "/Graphics.pdf",Mode.Create));           
doc.Open();        
PdfContentByte cb = writer.DirectContent;            
cb.MoveTo(570f, 20f);        
cb.LineTo(570f, 3324);         

cb.MoveTo(570f, 20f);
cb.LineTo(570f, 3324);
cb.ClosePath();
cb.Stroke();

cb.SetColorStroke(BaseColor.GREEN);

//start point (x,y)
//Start Point

cb.MoveTo(450f, 70f);

//Control Point 1, Control Point 2, End Point

cb.Circle(450f, 70f, 30f);

cb.Stroke();
doc.Close();

0 个答案:

没有答案