Overview

TallPDF.NET is a 100% managed .NET component for dynamic generation of PDF documents. Central to TallPDF.NET is a highly intuitive object model consisting of classes like Document, Section, Paragraph, Table, Footer, etc. You can generate documents either programmatically or from XML.

Feature highlights

  • Automatic pagination and page numbering.
  • Table of content generation.
  • Auto-formatted cross-references.
  • Text, tables, images, drawing and tables.
  • Headers and footers with automatic content
  • Do-not-break and keep-with-next
  • Subsetting of TrueType fonts

What's new in 4.0?

  • Windows Server 2008 and higher compatibility
  • Full HTML 4.01, XHTML and CSS 2.1 support
  • Generate digitally signed documents
  • AES (128 and 256 bit) support
  • Standard and Professional editions merged into one

4.0 is fully backwards compatible with 3.0.

c# convert TXT to PDF

1 using System; 2 using System.IO; 3 4 using TallComponents.PDF.Layout; 5 using TallComponents.PDF.Layout.Paragraphs; 6 using TallComponents.PDF.Layout.Fonts; 7 8 namespace txt2pdf 9 { 10 class Program 11 { 12 static void Main(string[] args) 13 { 14 Document document = new Document(); 15 16 Section section = new Section(); 17 section.PageSize = PageSize.Letter; 18 document.Sections.Add(section); 19 20 string[] lines = File.ReadAllLines("test.txt"); 21 22 foreach (string line in lines) 23 { 24 TextParagraph text = new TextParagraph(); 25 text.SpacingAfter = 12; 26 section.Paragraphs.Add(text); 27 28 Fragment fragment = new Fragment(); 29 fragment.FontSize = 12; 30 fragment.Font = Font.Courier; 31 fragment.Text = line; 32 text.Fragments.Add(fragment); 33 } 34 35 using (FileStream file = new FileStream( 36 "test.pdf", FileMode.Create, FileAccess.Write)) 37 { 38 document.Write(file); 39 } 40 } 41 } 42 }