Click or drag to resize
Pdf Library for .NET

PdfCanvasAddAsync(PdfPageElement, CancellationToken) Method

Adds a pdf page element to the canvas without waiting for it to be rendered, stopping when the specified token is cancelled.

Namespace: SelectPdf.Universal
Assembly: SelectPdf.HtmlToPdf.Universal (in SelectPdf.HtmlToPdf.Universal.dll) Version: 26.4
Syntax
public Task<PdfRenderingResult> AddAsync(
	PdfPageElement element,
	CancellationToken cancellationToken
)

Parameters

element  PdfPageElement
The page element to be rendered.
cancellationToken  CancellationToken
A token that stops the addition when it is cancelled.

Return Value

TaskPdfRenderingResult
A task that completes with the result of rendering the element.
Remarks
The element is rendered and placed as described for AddAsync(PdfPageElement). Cancelling the token stops an element that has not been placed yet - its background render is stopped in the engine - and its task then ends cancelled, leaving the canvas as it was. An element whose placement has already started is placed.
See Also