PDF .NET Library  .NET PDF Component Library. PDF creator, PDF maker.
Home Products Code Library Online Demos Support Buy About Us  
Code Library

How to use existing PDF documents as templates

The code sample below creates a PDF document using another PDF document as a template.

c# sample:

PDFCreationOptions options = new PDFCreationOptions();

options.TemplateFileName = "PDFTechLH.pdf";

options.TemplatePageNumber = 1;

options.TemplatePassword = "";

options.SetMargin(50, 160, 50, 160);

PDFDocument MyPdf = new PDFDocument("Templates.pdf", options);

MyPdf.CurrentPage.Body.SetTextAlignment(TextAlign.Justified);

MyPdf.CurrentPage.Body.SetColumnCount(ColumnCount.TwoColumn);

MyPdf.CurrentPage.Body.AddText("What a nice template.");

MyPdf.Save();

Back to PDF Code Library