Document construction
Create a PDF from scratch
Enter a heading. The server creates a new document, formats the heading, adds a repeating page header, and exports the result directly as Adobe PDF.
Ready to tryUse the controls above to interact with this demo.
What this demonstrates
Generate PDF documents server-side
A PDF does not require an existing template. ServerTextControl exposes the same document model used for rich-text editing, allowing applications to construct text, formatting, headers, tables, images, and other content entirely in code.
The finished document is saved directly into a byte array, so no temporary file is required before the result is returned to the browser.
API used
ServerTextControl.Save
How it works
The controller creates a temporary ServerTextControl, inserts and formats text through Selection, adds a section header, and calls Save with BinaryStreamType.AdobePDF. The Base64 response is loaded directly into the Document Viewer.
Source files
See the implementation
Inspect the client request, Razor view, and server-side PDF creation endpoint.