ConversionOptions.CancelToken Property

Gets or sets a CancellationToken for conversion task.

public CancellationToken CancelToken { get; set; }
Public Property CancelToken As CancellationToken

Property Value


Licensing Info

This property is a DynamicPDF HTML Converter feature. One of the following is required for non-evaluation usage:


Following code will cancel the conversion if it does not finish within a second.
ConversionOptions conversionOptions = new ConversionOptions(PageSize.A4, PageOrientation.Portrait, 20);
CancellationTokenSource tokenSource = new CancellationTokenSource();
conversionOptions.CancelToken = tokenSource.Token;
System.Threading.Tasks.Task.Run(() => { Thread.Sleep(1000); tokenSource.Cancel(); });
byte[] pdf = await Converter.ConvertAsync(new Uri(""), conversionOptions);


This property will be used to create the task for conversion, so that the task may be cancelled if needed.

See Also


In this topic