How to Render PDFs Behind a Corporate Proxy in C#
Enterprise applications that generate PDFs from HTML often run inside locked-down networks with no direct route to the internet. The problem surfaces at render time: an invoice or report template references a logo, web font, or stylesheet hosted on an external CDN, and inside the corporate network those requests fail silently. The document comes out unstyled, with broken images and missing fonts. Routing the rendering engine through the company proxy fixes this, and IronPDF accepts a proxy directly on its render call.
The Business Problem
A finance, healthcare, or insurance app produces client documents from web templates. Those templates pull external assets, but the server sits behind a firewall and proxy. Without proxy configuration, the engine cannot reach the assets, so the output looks broken. Many of these environments also run authenticated proxies, which adds credentials to the requirement.
The Solution
The proxy is a parameter on the RenderHtmlAsPdf method, not a property on the render options. Passing a proxy string routes all asset requests from the engine through that proxy.
using IronPdf;
var renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf(
htmlContent,
baseUrlOrPath: @"C:\templates\assets\",
proxy: "http://proxy.corp.local:8080"
);
pdf.SaveAs("report.pdf");
For an authenticated proxy, credentials go in the proxy URL. Special characters in the password must be percent-encoded.
string encoded = Uri.EscapeDataString("P@ssw0rd!");
string proxy = $"http://svc-account:{encoded}@proxy.corp.local:8080";
PdfDocument pdf = renderer.RenderHtmlAsPdf(htmlContent, baseUrlOrPath: null, proxy: proxy);
Rendering Internal URLs Behind a Proxy
The URL render method does not accept a proxy parameter. The practical pattern is to fetch the HTML with an HttpClient configured for the proxy, then render that HTML so the referenced assets route through the proxy too.
using System.Net;
using System.Net.Http;
var webProxy = new WebProxy("http://proxy.corp.local:8080")
{
Credentials = new NetworkCredential("svc-account", "P@ssw0rd!")
};
var handler = new HttpClientHandler { Proxy = webProxy, UseProxy = true };
using var httpClient = new HttpClient(handler);
string html = await httpClient.GetStringAsync("https://dashboard.internal.corp/report");
PdfDocument pdf = renderer.RenderHtmlAsPdf(html, baseUrlOrPath: null, proxy: "http://proxy.corp.local:8080");
Points to Plan For
- Proxy auth is not page auth: Credentials in the proxy URL authenticate against the proxy, which differs from website login credentials.
- Scheme refers to the proxy hop: An
http://proxy can still fetchhttps://resources, so the scheme choice is about whether the app-to-proxy connection needs TLS. - Containers and pipelines: Docker deployments and CI build agents usually have no egress, so the same proxy configuration applies there.
Result
With one parameter, teams get fully styled, branded PDFs out of applications running behind a corporate proxy, including authenticated environments and containers. Full configuration details are in the proxy guide.

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.