PdfDocument doc = new PdfDocument(); //Add a page to the document. PdfPage page = doc.Pages.Add(); //Create PDF graphics for the page. PdfGraphics graphics = page.Graphics; //Set the font. PdfFont font = new PdfStandardFont(PdfFontFamily.Courier, 14); //Simple HTML content string htmlText = "Essential PDF is a .NET " + "library with the capability to produce Adobe PDF files "; //Create new PDF HTML text element. PdfHTMLTextElement htmlTextElement = new PdfHTMLTextElement(htmlText, font, PdfBrushes.Black); htmlTextElement.TextAlign = TextAlign.Left; //Format Layout. PdfMetafileLayoutFormat format = new PdfMetafileLayoutFormat(); format.Layout = PdfLayoutType.Paginate; format.Break = PdfLayoutBreakType.FitPage; //Draw htmlString to PDF page. htmlTextElement.Draw(page, new RectangleF(0, 0, page.GetClientSize().Width, page.GetClientSize().Height), format); //Save the document. doc.Save("Output.pdf"); //Close the document. doc.Close(true);