The Document class is the heart of Aspose.PDF FOSS for .NET. It represents a complete PDF and provides access to every structure inside — pages, annotations, form fields, metadata, and embedded files.
Opening documents Load a PDF from a file, a byte array, or a stream:
using var doc = Document.Open(File.ReadAllBytes("input.pdf")); Console.WriteLine($"Pages: {doc.Pages.Count}"); Pages use 1-based indexing: doc.Pages[1] is the first page.
Creating from scratch using var doc = new Document(); var page = doc.Pages.Add(); page.Paragraphs.Add(new TextFragment("Hello, PDF!")); doc.Save("hello.pdf"); Tables, floating boxes, headers/footers, and graphs are all paragraph types that the layout engine places automatically.
...