Fires when the asynchronous PdfCompressorEngine.WriteAsync method finishes.
public event EventHandler<PdfCompressorWriteAsyncCompletedEventArgs> WriteAsyncCompleted
The event handler receives an argument of type PdfCompressorWriteAsyncCompletedEventArgs containing data related to this event. The PdfCompressorWriteAsyncCompletedEventArgs properties provide information specific to this event. Here is a summary of the most useful properties:
Property | Description |
---|---|
FileName | The name of the output PDF file. Can be null if the output was written to a stream. |
Stream | The stream containing the PDF output. Can be null if the output was written to a file. |
UserState | The userState parameter passed to the PdfCompressorEngine.WriteAsync method. |
Cancelled | true if the operation was cancelled, false otherwise. |
Error | The exception information class, if the operation threw an exception. null if the operation did not throw an exception. |
The PdfCompressorEngine.WriteAsync method succeeded if Cancelled
is false and Error
is null.
Refer to PdfCompressorWriteAsyncCompletedEventArgs for more information.
The WriteAsyncCompleted
property of the PdfCompressorEngine object allows you to register handlers for the WriteAsyncCompleted
event. The first parameter passed to the event handler indicates which PdfCompressorEngine object fired the event.
For more information, refer to Creating a Compressed PDF File.