WordToPdfConverterConvertToPdfAsync(String, CancellationToken) Method

Asynchronously converts a Word file from the specified file path to a PDF byte array. The input file must be a valid DOCX 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.

Definition

Namespace: Winnovative.Pdf.Next
Assembly: Winnovative.Pdf.Next.WordToPdf (in Winnovative.Pdf.Next.WordToPdf.dll) Version: 20.0.0
C#
public Task<byte[]> ConvertToPdfAsync(
	string docxFilePath,
	CancellationToken ct = default
)

Parameters

docxFilePath  String
The full path to the DOCX 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

Return Value

TaskByte
A byte array containing the generated PDF document

See Also