Changelog
Release history for CobaltPDF
Added
- Multi-target support: the package now ships builds for both
net6.0 and net8.0, broadening compatibility with projects on .NET 6, 7, 8, 9, and 10.
Changed
CobaltPDF.Requests dependency updated to v1.3.0 (now targets netstandard2.0).
Fixed
- Fixed Chromium default header/footer appearing when only one template is provided.
- Fixed
WithLazyLoadPages not working when combined with WithCustomJS or WithWaitStrategy.
Changed
WithCustomJS now waits for the page to be fully loaded before executing, so dynamically-injected elements (e.g. cookie consent buttons) are available.
- Client-side redirects (e.g. bbc.com → bbc.co.uk) are now detected before cookies, custom JS, and wait strategies run.
Changed
- Renamed
.Landscape() to .WithLandscape() for fluent API consistency.
- Renamed
.UseGrayscale() to .WithGrayscale() for fluent API consistency.
- Renamed
.EmulateMediaType() to .WithMediaType() — shorter and consistent with the With* convention.
- Renamed
.WaitFor() to .WithWaitStrategy() to avoid confusion with async operations.
- Renamed
.ReloadAfterStorageSet() to .WithReloadAfterStorage() for fluent API consistency.
- Renamed
.ConfigureFonts() to .WithFonts() — shorter and consistent with the With* convention.
Added
- Fluent
.WithWatermark() API for text and HTML watermarks with configurable opacity, rotation, and position.
- PDF metadata support — set title, author, subject, keywords, and creator via
.WithMetadata().
CloudEnvironment.ConfigureForAzure preset for Azure App Service and Container Apps deployments.
- New
.ScrollPage() option to trigger lazy-loaded images before capture.
Changed
- Default pool
MaxSize increased from 4 to 8 for better throughput on multi-core hosts.
- Improved browser recycling logic — instances are now recycled after 50 renders (previously 100).
Fixed
- Resolved rare deadlock when calling
RenderUrlAsPdfAsync with a CancellationToken that fires during navigation.
- Fixed header/footer templates not respecting
@media print styles.
Fixed
- Fixed
PreWarmAsync() throwing ObjectDisposedException when called immediately after Configure() on Linux containers.
- Corrected paper size calculation for custom dimensions specified in millimetres.
- Resolved an issue where
AddCookie() cookies were not sent on the initial page load when using RenderUrlAsPdfAsync.
Added
- Initial release of CobaltPDF — a high-performance HTML-to-PDF rendering engine for .NET.
- Chromium-powered rendering with full support for modern CSS (Grid, Flexbox, custom properties, animations).
- Managed browser pool with configurable
MinSize, MaxSize, and automatic recycling.
- Fluent API for PDF generation — chain options and call a single terminal method.
- Thread-safe singleton design with isolated browser contexts per render.
- Cookie, localStorage, and sessionStorage injection per render.
- Custom HTTP headers and User-Agent per render.
- Header and footer HTML templates with page number, total pages, and date tokens.
- PDF encryption with user/owner passwords and granular permission control.
- Wait strategies: network idle, DOM selector, JavaScript expression, custom signal, fixed delay.
- Custom JavaScript execution before capture with
cobaltNotifyRender() signal support.
- Cloud environment presets: Docker, AWS ECS, Low-Memory.
- ASP.NET Core dependency injection via
services.AddCobaltPdf().
- Companion package
CobaltPDF.Requests for lightweight microservice clients.
Changed
- Retargeted from
net8.0 to netstandard2.0 for maximum compatibility — usable from .NET Framework 4.6.1+, .NET Core 2.0+, and all modern .NET versions.
Added
- Added
PdfRequestMargins, PdfRequestWatermark, PdfRequestEncryption, and PdfRequestMetadata models.
- Added
PdfResponse with FromBytes() and ToStream() helpers.
Added
- Initial release — lightweight
PdfRequest and PdfResponse models for sending PDF generation requests to a CobaltPDF-powered microservice.
- Full JSON-serialisable request model mirroring the CobaltPDF fluent API.
- Cookie, header, encryption, metadata, watermark, and wait strategy support.