I work for IronSoftware as a QA engineer and find myself uniquely able to provide advice on this question about the IronPDF Nuget Packages for .NET.
Which Azure Plan: PDF File Rendering on Azure
For bulk Generating Pdf files in bulk, IronPdf in .NET applications on Azure I would highly recommend using the Basic B1 tier or higher, or the Premium Plan. The Free and Shared tiers, and the Consumption Plan, are not suitable for PDF rendering. The reason for this is that it uses a complete web browser to create PDF files from HTML code.
We need to provision enough resources to treat each render as your browser would treat any web page - it can take a second or two. The IronPDF library works in Azure WebApps, Functions and WebJobs. It works in both Linux and Windows variants, although I would recommend Windows variant Functions and WebApps as significantly better tested and easier to install.
This is simply because Linux support for .NET is more recent. Windows has a longer history and is easier to configure permissions for a PDF generator use case!
Caveat: Rendering SVG fonts into a PDF Document
One known limitation for generating PDF files using C# we have found is that Azure hosting platform does not support servers loading SVG fonts, such as Google Fonts, in their shared web-app tiers. This is because these shared hosting platforms are not allowed to access windows GDI+ graphics objects for security reasons. These restrictions are not present in Linux, or Windows in Docker containers however. Docker containers can be a great way to go.
Reference: https://ironpdf.com/docs/questions/azure/
Multithreaded PDF Generation
At the date of writing IronPdf is thread safe, but not truly multithreaded.
Only one PDF file can be rendered at a time per .NET process. It has been a major drawback on PDF document creation performance until 2021.For example this will run one-by-one even though its called in parallel to generate pdf documents simultaneously.
// using System.Linq;
// using System.Threading.Tasks;
var Renderer = new IronPdf.HtmlToPdf();
// Where Htmls is an iEnumerable of HTML strings
Parallel.ForEach(Htmls, html =>
{
Renderer.RenderHtmlAsPdf(html);
// works but not faster than formal foreach
}
A solution is found by updating to IronPDF 2021.9 and above:
// PM> Install-Package IronPdf
// using System.Linq;
// using System.Threading.Tasks;IronPdf.Installation.DefaultRenderingEngine = IronPdf.Rendering.PdfRenderingEngine.Chrome;var Renderer = new IronPdf.HtmlToPdf();Parallel.ForEach(Htmls, html =>
{
Renderer.RenderHtmlAsPdf(html);
// works in multiple threads !!
}
In short: remove the old IronPDF Nuget package and replace it with IronPDF 2021.9 or above
IronPd 2021.9 is a ground up rebuild of our .NET PDF rendering technology:
Providing effortless multithreading and Async, using as many CPU cores as you wish. For SAAS and high-load applications this may be an order of magnitude faster; outperforming direct browser usage and web-drivers. You can also use the new 2021 API:
// using IronPdf;
// PM> Install-Package IronPdf
ChromePdfRenderer Renderer = new ChromePdfRenderer();
Renderer.RenderingOptions.FitToPaper = true;
Renderer.RenderingOptions.CssMediaType = IronPdf.Rendering.PdfCssMediaType.Screen;
Renderer.RenderingOptions.PrintHtmlBackgrounds = true;
Renderer.RenderingOptions.CreatePdfFormsFromHtml = true;
var doc = await Renderer.RenderHtmlAsPdfAsync ("<h1>Hello world!</h1>");
Azure is a first class citizen of the new IronPDF renderer which is based on the latest "Blink!" HTML string to pdf file rendering! Choose from Chrome Identical PDF creation or Enhanced rendering settings - which we find more accurate and easy to code for than Chrome.
We also recommend this route because it adds Section 508 accessibility compliance in C# PDF Generator : Producing accessible PDFs using the PDF(UA) tagged PDF standard.
The IronPDF team have maintained and improved full support for: .Net 5, Core and Framework 4.0+ support. We also tested it with 1156 green unit & integration tests in the current release (2021.9)