I am using Aspose.Pdf version 4.1.
I am using the Aspose.Pdf.Pdf class:
Aspose.Pdf.Pdf pdfExport = new Aspose.Pdf.Pdf();
how do I add page numbers?
Hi Jonathan,
Thank you for considering Aspose.Pdf for .NET.
You can add Sections in your PDF object to create new Pages in your document. Please see the following sample code in this regard.
//Create pdf document
Aspose.Pdf.Pdf pdf1 = new Aspose.Pdf.Pdf();
//Add a section into the pdf document
Aspose.Pdf.Section sec1 = pdf1.Sections.Add();
//Add a text paragraph into the section
sec1.Paragraphs.Add(new Aspose.Pdf.Text("Hello World"));
//Save the document
pdf1.Save("HelloWorld.pdf");
Also, you are using a very old version of Aspose.Pdf for .NET. We would recommend you to download and try the latest version of Aspose.Pdf for .NET v6.8 . This feature supports a lot of new features and functionalities. In the new version we have also merged Aspose.Pdf for .NET and Aspose.Pdf.Kit for .NET into a single product. You can use Aspose.Pdf.Generator.Pdf in the latest version instead of Aspose.Pdf.Pdf class. Please see the following documentation link regarding creating a new pdf document using Aspose.Pdf for .NET.
Create a Hello World PDF document through API
Please feel free to contact support in case you have any query or face any problem.
Thank You & Best Regards,
Hi Jonathan,