We have further investigated the earlier logged ticket and found that you can add page numbers to the output PDF file using the following code snippet:
using (var configuration = new Aspose.Html.Configuration())
var userAgent = configuration.GetService<Aspose.Html.Services.IUserAgentService>();
userAgent.UserStyleSheet = @"@page
/* Page counter located at the bottom of the page */
var options = new Aspose.Html.Rendering.Pdf.PdfRenderingOptions();
options.PageSetup.AnyPage.Margin = new Aspose.Html.Drawing.Margin(25);
using (var document = new Aspose.Html.HTMLDocument("sample.html", configuration))
using (var device = new Aspose.Html.Rendering.Pdf.PdfDevice(options, "out.pdf"))
An example, which demonstrates, how to add header and the total number of pages, can be found here https://docs.aspose.com/html/net/css-extensions/.
There are a couple of ways to change the font size, so in order to propose the most suitable method, we will need more information about the use case.
- Do you want to change the font size of all elements or only of the particular ones?
- Changing the font size may lead to a broken layout, so maybe you want to rescale document size instead?