How to Start Convert PDF Read PDF Build PDF Work with PDF Modules PDF Document PDF Pages Text Image Graph & Path Annotation, Markup & Drawing Redaction Security Digital Signature Forms Watermark Bookmark Link File Attachment File Metadata Printing Work with Other SDKs Barcode read Barcode create OCR Twain

Using C# PDF SDK
C# PDF Builder: How to add Footnote and Endnote to PDF file


C# Demo Code to add Footnote and Endnote to adobe pdf file













Add a simple footnote


String outputFilePath = Program.RootPath + "\\" + "Sample81.pdf";

Document document = new Document();

PDFBuildHandler.Create(document, outputFilePath);

document.Open();
document.SetFootnoteInfo(new FootnoteSetting());

Paragraph p = new Paragraph();
p.AddChunk(new TextChunk("This is a sample for footnote"));

//  insert a footnote
Footnote footnote1 = new Footnote("This is the 1st footnote");
p.AddChunk(footnote1);

p.AddChunk(new TextChunk("."));

p.AddChunk(new TextChunk("This is a sample for the 2nd footnote"));

//  insert a footnote
Footnote footnote2 = new Footnote("This is the 2nd footnote");
p.AddChunk(footnote2);

p.AddChunk(new TextChunk("."));

document.Add(p);

document.Close();




Add a simple endnote


String outputFilePath = Program.RootPath + "\\" + "Sample82.pdf";

Document document = new Document();

PDFBuildHandler.Create(document, outputFilePath);

document.Open();
document.SetEndnoteInfo(new EndnoteSetting());

Paragraph p = new Paragraph();

p.AddChunk(new TextChunk("This is a sample for endnote"));

//  insert a endnote
Endnote endnote1 = new Endnote("This is the 1st endnote");
p.AddChunk(endnote1);

p.AddChunk(new TextChunk(". This is a sample for the 2nd endnote"));

//  insert a endnote
Endnote endnote2 = new Endnote("This is the 2nd endnote");
p.AddChunk(endnote2);

p.AddChunk(new TextChunk("."));

document.Add(p);

//  insert a new page
document.NewPage();

document.Add(new Paragraph("This is the 2nd page."));

document.Close();