Interface IPdfGenerator
Fluent configuration + render contract for a single PDF generation operation.
public interface IPdfGenerator
Methods
AddCookie(string, string, string?, string)
IPdfGenerator AddCookie(string name, string value, string? domain = null, string path = "/")
Parameters
Returns
AddLocalStorage(string, string)
IPdfGenerator AddLocalStorage(string key, string value)
Parameters
Returns
AddSessionStorage(string, string)
IPdfGenerator AddSessionStorage(string key, string value)
Parameters
Returns
RenderHtmlAsPdfAsync(string, CancellationToken)
Task<PdfDocument> RenderHtmlAsPdfAsync(string html, CancellationToken cancellationToken = default)
Parameters
htmlstringcancellationTokenCancellationToken
Returns
RenderHtmlFileAsPdfAsync(string, CancellationToken)
Task<PdfDocument> RenderHtmlFileAsPdfAsync(string filePath, CancellationToken cancellationToken = default)
Parameters
filePathstringcancellationTokenCancellationToken
Returns
RenderUrlAsPdfAsync(string, CancellationToken)
Task<PdfDocument> RenderUrlAsPdfAsync(string url, CancellationToken cancellationToken = default)
Parameters
urlstringcancellationTokenCancellationToken
Returns
WithCspBypass(bool)
IPdfGenerator WithCspBypass(bool enable = true)
Parameters
enablebool
Returns
WithCustomJS(string)
IPdfGeneratorFinal WithCustomJS(string script)
Parameters
scriptstring
Returns
WithEncryption(PdfEncryptionOptions)
IPdfGenerator WithEncryption(PdfEncryptionOptions encryption)
Parameters
encryptionPdfEncryptionOptions
Returns
WithFonts(string)
IPdfGenerator WithFonts(string fontDirectoryPath)
Parameters
fontDirectoryPathstring
Returns
WithFooter(string)
IPdfGenerator WithFooter(string htmlOrFilePath)
Parameters
htmlOrFilePathstring
Returns
WithGrayscale()
IPdfGenerator WithGrayscale()
Returns
WithHeader(string)
IPdfGenerator WithHeader(string htmlOrFilePath)
Parameters
htmlOrFilePathstring
Returns
WithHttpHeader(string, string)
IPdfGenerator WithHttpHeader(string name, string value)
Parameters
Returns
WithHttpHeaders(IDictionary<string, string>)
IPdfGenerator WithHttpHeaders(IDictionary<string, string> headers)
Parameters
headersIDictionary<string, string>
Returns
WithLandscape()
IPdfGenerator WithLandscape()
Returns
WithLazyLoadPages(int, TimeSpan?, TimeSpan?)
IPdfGenerator WithLazyLoadPages(int pageCount, TimeSpan? delay = null, TimeSpan? timeout = null)
Parameters
Returns
WithMargins(MarginOptions)
IPdfGenerator WithMargins(MarginOptions margins)
Parameters
marginsMarginOptions
Returns
WithMediaType(CssMediaType)
IPdfGenerator WithMediaType(CssMediaType type)
Parameters
typeCssMediaType
Returns
WithMetadata(Action<MetadataOptions>)
IPdfGenerator WithMetadata(Action<MetadataOptions> configure)
Parameters
configureAction<MetadataOptions>
Returns
WithPageRanges(string)
IPdfGenerator WithPageRanges(string ranges)
Parameters
rangesstring
Returns
WithPageSize(string, string)
IPdfGenerator WithPageSize(string width, string height)
Parameters
Returns
WithPaperFormat(string)
IPdfGenerator WithPaperFormat(string format)
Parameters
formatstring
Returns
WithPrintBackground(bool)
IPdfGenerator WithPrintBackground(bool enable = true)
Parameters
enablebool
Returns
WithReloadAfterStorage()
IPdfGenerator WithReloadAfterStorage()
Returns
WithScale(float)
IPdfGenerator WithScale(float scale)
Parameters
scalefloat
Returns
WithUserAgent(string)
IPdfGenerator WithUserAgent(string userAgent)
Parameters
userAgentstring
Returns
WithWaitStrategy(WaitOptions)
IPdfGenerator WithWaitStrategy(WaitOptions strategy)
Parameters
strategyWaitOptions
Returns
WithWatermark(WatermarkOptions)
IPdfGenerator WithWatermark(WatermarkOptions watermark)
Parameters
watermarkWatermarkOptions