Table of Contents

Namespace CobaltPdf.WebKit

Classes

CloudEnvironment

Ready-made PoolOptions presets for common deployment targets.

Provided for drop-in API compatibility with the Chromium-based CobaltPDF, so startup code written for that engine compiles and runs unchanged here. Each preset does apply useful pool sizing (MinSize / MaxSize) — that part takes effect. However the Chromium command-line switches it adds (NoSandbox, DisableDevShm, DisableGpu, SingleProcess) are stored but ignored: this backend renders with WebKitGTK, which does not read Chromium flags.

To tune WebKit, set PoolOptions directly — MinSize, MaxSize, MaxUsesPerBrowser, MaxMemoryMb, MaxQueueDepth, RenderTimeout. The flag constants below have no effect on rendering.

CobaltCookie

Represents a browser cookie configuration used during PDF generation.

CobaltEngine

The main PDF renderer for CobaltPdf.WebKit. Create one instance and call fluent methods to configure each render, finishing with RenderUrlAsPdfAsync(string, CancellationToken) or RenderHtmlAsPdfAsync(string, CancellationToken).

CobaltPdfServiceExtensions

DI registration helpers for the WebKitGTK-backed CobaltPdf.

LazyLoadOptions

Lazy-load scroll configuration applied before PDF capture.

MarginOptions

Represents the page margins for a PDF document.

MetadataOptions

Descriptive metadata embedded in the generated PDF.

PdfDocument

The rendered PDF artifact.

PdfDocumentTaskExtensions

Extensions that let PdfDocument operations chain directly off the render Task<TResult> without an intermediate await.

PdfEncryptionOptions

Password protection / permissions for the generated PDF.

PdfGenerator

Concrete PDF generator. Mirrors the original CobaltPdf fluent surface and dispatches each render to a WebKitGTK subprocess. By default the subprocess runs inline from a bundled portable WebKit (auto-provisioned by BundleProvisioner); a Docker fallback exists for local dev.

PdfOptions

Configuration options used when generating a PDF.

PdfRequestExtensions

Extension methods that execute a CobaltPdf.Requests.PdfRequest using a WebKit CobaltEngine instance.

PoolBusyException

Thrown by the render pool when MaxQueueDepth is set (> 0) and a render request arrives while every render slot is in use and the bounded wait-queue is already full.

This is deliberate backpressure, not a failure: the work was never started, so it is always safe to retry. Hosts should translate it into a "server busy" response — HTTP 503 Service Unavailable with a Retry-After header — rather than a generic 500, so callers and load balancers know to back off and retry shortly instead of treating it as a hard error.

Never thrown when MaxQueueDepth is 0 (the default), which keeps the historical unbounded-queue behaviour.

PoolOptions

Configuration options for the rendering worker pool and the bundle provisioner. The defaults are sized for a typical Azure App Service Linux dyno; override anything that does not fit your host.

WaitOptions

Base class for defining a wait strategy before PDF rendering.

WatermarkOptions

Visual settings for a watermark injected into the generated PDF.

Structs

CobaltPoolStatistics

A point-in-time snapshot of the render pool's state and lifetime counters, returned by GetPoolStatistics(). Useful for health endpoints, capacity dashboards, and autoscaling signals.

The gauges (CurrentWorkers, LeasedWorkers, IdleWorkers, QueuedWaiters) are read without locking, so on a busy pool they are a close-but-not-transactional view; the cumulative counters are exact.

Interfaces

IPdfGenerator

Fluent configuration + render contract for a single PDF generation operation.

IPdfGeneratorFinal

Continuation of the fluent chain after WithCustomJS has been called.

Enums

BrowserLoggingMode

Specifies the destination modes for capturing browser-level console logs.

CssMediaType

CSS media type to emulate during PDF rendering.

HorizontalAlignment

Horizontal alignment for watermark placement.

MarginUnit

Measurement units for margins.

VerticalAlignment

Vertical alignment for watermark placement.

WatermarkPosition

Convenience positions for watermark placement.

WatermarkStyle

Predefined visual styles for text watermarks.