Class ChromeClient<T>
Chrome client implementation which uses interop to satisfy functionality using native code
ChromeClient utilize IronSoftware.JobQueue.JobQueueManager to queue requests to the native code
Inheritance
System.Object
ChromeClient<T>
Implements
System.IDisposable
Assembly: IronPdf.dll
Syntax
public class ChromeClient<T> : Object, IChromeClient, IDisposable where T : ChromeDeploymentBase
Type Parameters
ChromeClient<T> is what IronPDF uses internally to wrap the native Chrome rendering engine and queue render requests through IronSoftware.JobQueue.JobQueueManager. The type parameter T (constrained where T : ChromeDeploymentBase) selects the deployment strategy that locates the Chrome native binary on disk. The URL slug shows ChromeClient-1 because docfx encodes generic arity as a numeric suffix; the actual class is ChromeClient<T>.
End-user C# code does not normally construct ChromeClient<T> directly. Application code calls ChromePdfRenderer, which inherits from ChromeClientAccessor and reaches a configured ChromeClient instance internally. The class is documented here so that consumers of the IronPDF source layout, integrators writing thin wrappers around the engine, and developers debugging IronSoftware.JobQueue queue behavior can map the renderer-level API to the underlying primitives. Typical reasons to look at this page include investigating thread-affinity questions, comparing local and remote deployment paths, and reading the exact shape of the engine's render-method signatures.
The 15 members on ChromeClient<T>, grouped by purpose, are: render methods (RenderPDFFromHTML, RenderPDFFromURI, RenderPDFFromFile, RenderPDFFromZIP, RenderPDFFromImages), post-render editing (AddHtmlHeadersAndFooters, AddStamp, AddStamps), request context and measurement (ApplyCookies, ClearCookies, MeasureHTML, ExtractImagesFromMultiFrameImageFormats), and lifecycle (Initialize, Dispose, Finalize). The single documented constructor accepts an IronSoftware.Pdfium.IPdfClient. For the engine-level architecture context, see the Chrome rendering engine guide.
using IronPdf;
// Canonical path: end-user code uses ChromePdfRenderer.
// ChromePdfRenderer inherits from ChromeClientAccessor and reaches
// a ChromeClient<T> instance internally; direct construction is rare.
ChromePdfRenderer renderer = new ChromePdfRenderer();
renderer.RenderingOptions.MarginTop = 10;
renderer.RenderingOptions.MarginBottom = 10;
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Hello from Chrome</h1>");
pdf.SaveAs("chrome-client-output.pdf");
For deployment choices that determine the T type parameter at runtime, the native versus remote engine guide describes the in-process and out-of-process options. Multithreaded callers should read the async and multithreading guide, which explains how the JobQueueManager behind ChromeClient<T> serializes native calls.
Constructors
ChromeClient(IPdfClient)
Create a new local chrome client
Declaration
public ChromeClient(IPdfClient pdfClient)
Parameters
| Type |
Name |
Description |
| IronSoftware.Pdfium.IPdfClient |
pdfClient |
|
Methods
Declaration
public void AddHtmlHeadersAndFooters(IDocumentId id, string owner_password, string user_password, ChromePdfRenderOptions Options, List<int> pages, string url, string htmlTitle, string pdfTitle)
Parameters
| Type |
Name |
Description |
| IronSoftware.Abstractions.Pdf.IDocumentId |
id |
|
| System.String |
owner_password |
|
| System.String |
user_password |
|
| ChromePdfRenderOptions |
Options |
|
| System.Collections.Generic.List<System.Int32> |
pages |
|
| System.String |
url |
|
| System.String |
htmlTitle |
|
| System.String |
pdfTitle |
|
AddStamp(IDocumentId, String, String, Stamper, IEnumerable<IPdfPage>)
Declaration
public void AddStamp(IDocumentId id, string owner_password, string user_password, Stamper Stamper, IEnumerable<IPdfPage> pages)
Parameters
| Type |
Name |
Description |
| IronSoftware.Abstractions.Pdf.IDocumentId |
id |
|
| System.String |
owner_password |
|
| System.String |
user_password |
|
| Stamper |
Stamper |
|
| System.Collections.Generic.IEnumerable<IPdfPage> |
pages |
|
AddStamps(IDocumentId, String, String, IEnumerable<Stamper>, IEnumerable<IPdfPage>)
Declaration
public void AddStamps(IDocumentId id, string owner_password, string user_password, IEnumerable<Stamper> Stampers, IEnumerable<IPdfPage> pages)
Parameters
| Type |
Name |
Description |
| IronSoftware.Abstractions.Pdf.IDocumentId |
id |
|
| System.String |
owner_password |
|
| System.String |
user_password |
|
| System.Collections.Generic.IEnumerable<Stamper> |
Stampers |
|
| System.Collections.Generic.IEnumerable<IPdfPage> |
pages |
|
ApplyCookies(String, Dictionary<String, String>)
Declaration
public void ApplyCookies(string url, Dictionary<string, string> cookies)
Parameters
| Type |
Name |
Description |
| System.String |
url |
|
| System.Collections.Generic.Dictionary<System.String, System.String> |
cookies |
|
ClearCookies()
Declaration
public void ClearCookies()
Dispose()
Declaration
public virtual void Dispose()
Declaration
public static (List<string>, List<string>) ExtractImagesFromMultiFrameImageFormats(List<string> imagePathList)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.List<System.String> |
imagePathList |
|
Returns
| Type |
Description |
| System.ValueTuple<System.Collections.Generic.List<System.String>, System.Collections.Generic.List<System.String>> |
|
Finalize()
Declaration
protected override void Finalize()
Initialize()
Declaration
protected virtual void Initialize()
MeasureHTML(String, Uri, String, ChromePdfRenderOptions)
Measure the size of an HTML fragment.
Declaration
public Size MeasureHTML(string html, Uri baseUrl, string proxy, ChromePdfRenderOptions renderOptions)
Parameters
| Type |
Name |
Description |
| System.String |
html |
The HTML fragment to measure.
|
| System.Uri |
baseUrl |
Optional: a base URL.
|
| System.String |
proxy |
Optional: a proxy.
|
| ChromePdfRenderOptions |
renderOptions |
Render options to use when rendering the HTML fragment.
|
Returns
| Type |
Description |
| SixLabors.ImageSharp.Size |
The size of the HTML fragment.
|
RenderPDFFromFile(ChromePdfRenderOptions, ChromeHttpLoginCredentials, String)
Declaration
public (IDocumentId, string) RenderPDFFromFile(ChromePdfRenderOptions renderOptions, ChromeHttpLoginCredentials loginCredentials, string filePath)
Parameters
Returns
| Type |
Description |
| System.ValueTuple<IronSoftware.Abstractions.Pdf.IDocumentId, System.String> |
|
RenderPDFFromHTML(String, Uri, String, ChromePdfRenderOptions, ChromeHttpLoginCredentials)
Declaration
public (IDocumentId, string) RenderPDFFromHTML(string html, Uri baseUrl, string proxy, ChromePdfRenderOptions renderOptions, ChromeHttpLoginCredentials loginCredentials)
Parameters
Returns
| Type |
Description |
| System.ValueTuple<IronSoftware.Abstractions.Pdf.IDocumentId, System.String> |
|
RenderPDFFromImages(List<String>, IEnumerable<(Byte[], String)>, ImageBehavior, ChromePdfRenderOptions)
Declaration
public IDocumentId RenderPDFFromImages(List<string> imagePathList, IEnumerable<(byte[], string)> images, ImageBehavior behavior, ChromePdfRenderOptions RenderingOptions)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.List<System.String> |
imagePathList |
|
| System.Collections.Generic.IEnumerable<System.ValueTuple<System.Byte[], System.String>> |
images |
|
| ImageBehavior |
behavior |
|
| ChromePdfRenderOptions |
RenderingOptions |
|
Returns
| Type |
Description |
| IronSoftware.Abstractions.Pdf.IDocumentId |
|
RenderPDFFromURI(Uri, ChromePdfRenderOptions, ChromeHttpLoginCredentials)
Declaration
public IDocumentId RenderPDFFromURI(Uri url, ChromePdfRenderOptions RenderingOptions, ChromeHttpLoginCredentials LoginCredentials)
Parameters
Returns
| Type |
Description |
| IronSoftware.Abstractions.Pdf.IDocumentId |
|
RenderPDFFromZIP(in Byte[], String, ChromePdfRenderOptions, ChromeHttpLoginCredentials)
Declaration
public (IDocumentId, string) RenderPDFFromZIP(in byte[] bytes, string mainFile, ChromePdfRenderOptions RenderingOptions, ChromeHttpLoginCredentials LoginCredentials)
Parameters
Returns
| Type |
Description |
| System.ValueTuple<IronSoftware.Abstractions.Pdf.IDocumentId, System.String> |
|
Implements
System.IDisposable