Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Mon Sep 19, 2016 10:26 am

Hi, is it possible to programmatically edit a PDF file such as inserting a date ?

Thanks

derek
 
Posts: 42
Joined: Mon Nov 19, 2012 11:55 am

Tue Sep 20, 2016 7:40 am

Hi,

Thanks for your inquiry. Here are the codes for your reference.
Code: Select all
PdfDocument document=new PdfDocument();
document.LoadFromFile("sample.pdf");
PdfFont font = new PdfFont(PdfFontFamily.Helvetica, 20f);
PdfSolidBrush brush = new PdfSolidBrush(Color.Red);
document.Pages[0].Canvas.DrawString(DateTime.Now.ToShortDateString(), font, brush, 100, 100);
document.SaveToFile("result.pdf", FileFormat.PDF);


Sincerely,
Alan
E-iceblue support team
User avatar

Alan.Li
 
Posts: 35
Joined: Mon Sep 05, 2016 2:51 am

Return to Spire.PDF