Generating Complete, Branded PDFs from Apps Behind a Corporate Proxy
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");
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");
Imports IronPdf
Dim renderer As New ChromePdfRenderer()
Dim pdf As PdfDocument = 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);
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);
Imports System
Dim encoded As String = Uri.EscapeDataString("P@ssw0rd!")
Dim proxy As String = $"http://svc-account:{encoded}@proxy.corp.local:8080"
Dim pdf As PdfDocument = renderer.RenderHtmlAsPdf(htmlContent, baseUrlOrPath:=Nothing, 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");
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");
Imports System.Net
Imports System.Net.Http
Dim webProxy As New WebProxy("http://proxy.corp.local:8080") With {
.Credentials = New NetworkCredential("svc-account", "P@ssw0rd!")
}
Dim handler As New HttpClientHandler With {
.Proxy = webProxy,
.UseProxy = True
}
Using httpClient As New HttpClient(handler)
Dim html As String = Await httpClient.GetStringAsync("https://dashboard.internal.corp/report")
Dim pdf As PdfDocument = renderer.RenderHtmlAsPdf(html, baseUrlOrPath:=Nothing, proxy:="http://proxy.corp.local:8080")
End Using
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.
Frequently Asked Questions
Why do enterprise applications struggle with PDF rendering behind a corporate proxy?
Enterprise applications often run inside networks that are locked down and cannot directly access external resources. This leads to issues like broken images and missing fonts in PDFs when external assets are not accessible.
How does IronPDF solve PDF rendering issues behind a proxy?
IronPDF allows you to specify a proxy directly in the `RenderHtmlAsPdf` method, routing all asset requests through the proxy to ensure external resources are accessed and rendered correctly.
Can IronPDF handle authenticated proxies for PDF rendering?
Yes, IronPDF supports authenticated proxies. Credentials can be included in the proxy URL, and special characters in passwords should be percent-encoded.
What is the method to render internal URLs behind a proxy using IronPDF?
For internal URLs, use an `HttpClient` configured with a proxy to fetch the HTML first, then render that HTML with IronPDF so that all referenced assets are routed through the proxy.
What should be considered when configuring proxies for Docker deployments with IronPDF?
Docker deployments and CI build agents usually lack egress, so the same proxy configuration used for applications behind a corporate proxy should be applied to ensure resource access.
Does the scheme of the proxy URL affect the resources fetched by IronPDF?
The scheme of the proxy URL (`http://` or `https://`) is important for the connection between the app and the proxy. An `http://` proxy can still fetch `https://` resources, so the scheme choice is about whether TLS is needed for the app-to-proxy connection.
What is the impact of using a proxy parameter in IronPDF?
By using a proxy parameter, IronPDF enables applications to generate fully styled, branded PDFs even when running behind a corporate proxy or in authenticated environments and containers.
How are special characters in proxy passwords handled in IronPDF?
Special characters in proxy passwords need to be percent-encoded when forming the proxy URL for IronPDF to authenticate properly.
What is the difference between proxy authentication and page authentication?
Proxy authentication involves credentials in the proxy URL for accessing the proxy server, while page authentication pertains to logging into a particular website or web service.

