Class IronPdfService
Service for converting HTML to PDF using IronPDF library.
Inherited Members
Namespace: DataWeb.Reporting.IronPdf
Assembly: DataWeb.Reporting.IronPdf.dll
Syntax
public class IronPdfService : IPdfService, IIronPdfService
Constructors
IronPdfService(IHttpService, IConfigurationService)
Initializes a new instance of the IronPdfService class.
Declaration
public IronPdfService(IHttpService httpService, IConfigurationService configurationService)
Parameters
| Type | Name | Description |
|---|---|---|
| IHttpService | httpService | Service for HTTP operations. |
| IConfigurationService | configurationService | Service for retrieving configuration settings. |
Properties
Name
Gets the name of the PDF service provider.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
HtmlToStreamAsync(string, PdfOptions, CancellationToken)
Converts HTML content to a PDF stream asynchronously.
Declaration
public Task<Stream> HtmlToStreamAsync(string html, PdfOptions options = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | html | The HTML content to convert. |
| PdfOptions | options | Optional PDF rendering options. If null, default options are used. |
| CancellationToken | cancellationToken | Token to cancel the asynchronous operation. |
Returns
| Type | Description |
|---|---|
| Task<Stream> | A stream containing the generated PDF document. |