Skip to main content

ASPxClientRichEdit.ExportToPdf Method

Exports the current document to PDF and invokes the PdfExported event.

Declaration

ExportToPdf(options?: ((pdfDocument: any) => void) | {
    modifyPdfDocument?: (pdfDocument: any) => void;
    modifyPdfPage?: (pdfDocument: any) => void;
}): void

Parameters

Name Type Description
options (pdfDocument: any) => void | {modifyPdfDocument: (pdfDocument: any) => void, modifyPdfPage: (pdfDocument: any) => void}

A function that allows you to modify the PDF document before it is downloaded; or an object that contains modifyPdfDocument and modifyPdfPage functions.

Remarks

The exportToPdf method exports the current document to the Portable Document Format (PDF). You can write a function to modify each page after it is exported (modifyPdfPage), or modify the document after the export is completed (modifyPdfDocument).

The pdfDocument parameter is an object of the PDFKit library. If an export fails, the parameter returns null.

The control invokes the PdfExported event. Handle it to save the exported document. To access the PDF file, use the Base64 parameter.

Important

If you use the ExportToPdf method, you should provide a list of available fonts and their sources to be uploaded to the client.

Tip

Use the DownloadPdf method to download the current document as PDF file.

See Also