Client-side export
Download a PDF directly in the browser
Save the current editor content as Adobe PDF without sending it to a custom controller endpoint.
Fast client-side deliveryThe browser receives the PDF data from the editor and starts the download immediately.
Ready to tryUse the controls above to interact with this demo.
What this demonstrates
Export PDF JavaScript
Client-side export is convenient for a quick download when no server-side PDF customization or persistence is required.
Key members
Export from the editor
TXTextControl.saveDocument
Start the download
URL.createObjectURL
How it works
The browser calls TXTextControl.saveDocument with AdobePDF. The callback returns the PDF data, which is placed in a temporary download link and clicked programmatically.
This avoids a server round trip and is ideal for user-triggered downloads. Use the server-side export demo when the PDF must be processed or stored centrally.
TXTextControl.saveDocument(
TXTextControl.StreamType.AdobePDF,
event => downloadBase64(
event.data,
"document.pdf",
"application/pdf"),
undefined,
showError);
NuGet packages
TXTextControl.TextControl.Core.SDK
34.0.4
Provides the core document model and server-side document processing APIs.
dotnet add package TXTextControl.TextControl.Core.SDK --version 34.0.4
Provides the browser-based TX Text Control document editor and JavaScript API.
dotnet add package TXTextControl.Web --version 34.4.0
TXTextControl.Web.DocumentEditor.Backend
34.4.0
Hosts the WebSocket-based backend used by the browser document editor.
dotnet add package TXTextControl.Web.DocumentEditor.Backend --version 34.4.0
Source files
See the implementation
The view, browser behavior, and controller are encapsulated in Demos/RichTextEditor/DocumentManagement/ExportPDFClient.