ExcelToPdfConverterConvertToPdfAsync(String, CancellationToken) Method
Asynchronously converts an Excel file from the specified file path to a PDF byte array.
The input file must be a valid .xlsx format document. The resulting PDF content is returned as a byte array,
which can be saved to disk, sent over a network, or written directly to a response stream
Namespace: HiQPdf.NextAssembly: HiQPdf.Next.ExcelToPdf (in HiQPdf.Next.ExcelToPdf.dll) Version: 18.0.0
public Task<byte[]> ConvertToPdfAsync(
string excelFilePath,
CancellationToken ct = default
)
- excelFilePath String
- The full path to the .xlsx file that will be converted to PDF
- ct CancellationToken (Optional)
-
A cancellation token that can be used to cancel the asynchronous operation. When cancellation
is requested the task returned by this method will complete by throwing
OperationCanceledException as soon as possible
TaskByteA byte array containing the generated PDF document