๐Ÿ“ Hello World

The simplest possible PDF โ€” create a single page with one line of text.

C# โ€” Hello World
using ObviousPDF;

// Create a new PDF document. This is the main entry point for ObviousPDF.
var doc = new PdfDocument();

// Set document metadata โ€” good practice even for simple PDFs.
doc.Info.Title = "Hello World";
doc.Info.Author = "ObviousPDF";

// Add a US Letter page (612ร—792 points, the default).
// The coordinate origin (0,0) is at the bottom-left corner.
var page = doc.AddPage();

// Add text at position (72, 720) โ€” 1 inch from the left,
// 10 inches from bottom. Default font is Helvetica 12pt black.
page.AddText("Hello, World!", 72, 720);

// Save the document to disk.
doc.Save("hello.pdf");
Screenshot of the Hello World PDF showing a clean white US Letter page with 'Hello, World!' text in Helvetica 12pt positioned at 1 inch from the left edge and 10 inches from the bottom

You should see a plain white US Letter page with "Hello, World!" in Helvetica 12 pt near the top-left, with no other content.
File: 01_hello_world.pdf

โ™ฟ Accessibility Note

This minimal example does not include tagging for accessibility. For production documents, always enable tagged PDF by calling doc.EnableTaggedPdf(), setting doc.Language, and using AddTaggedText() instead of AddText(). See the Accessible Document example.

Key Concepts

ConceptDetails
Coordinate originBottom-left corner of the page (0, 0)
UnitsPoints โ€” 1 point = 1/72 inch
Default page sizeUS Letter: 612 ร— 792 points (8.5 ร— 11 inches)
Default fontHelvetica 12pt, black
Position (72, 720)1 inch from left, 10 inches from bottom