Skip to content
Document Authoring DA  API Docs v1.9.1
npmGitHub

CreateDocumentFromPlaintextOptions

CreateDocumentFromPlaintextOptions:

{
pageSize?: { width: number; height: number } | "Letter" | "A4" | "A5" | "A6";
pageMargins?: { left: number; right: number; bottom: number; top: number; header?: number; footer?: number };
}

Options for creating documents from plain text.

// Create document with default page settings
const doc = await system.createDocumentFromPlaintext('Hello World');
// Create document with standard page size
const doc = await system.createDocumentFromPlaintext('My content', {
pageSize: 'A4',
});
// Create document with custom page size (in points, 72 points = 1 inch)
const doc = await system.createDocumentFromPlaintext('My content', {
pageSize: { width: 612, height: 792 }, // US Letter in points
});
// Create document with custom margins
const doc = await system.createDocumentFromPlaintext('My content', {
pageSize: 'Letter',
pageMargins: {
left: 72, // 1 inch
right: 72, // 1 inch
top: 72, // 1 inch
bottom: 72, // 1 inch
},
});
// Process multi-paragraph text
const text = `First paragraph
Second paragraph with line break\nand continuation.
Third paragraph with\ttab character.`;
const doc = await system.createDocumentFromPlaintext(text, {
pageSize: 'Letter',
});

DocAuthSystem.createDocumentFromPlaintext for creating documents from text.

optional pageSize: { width: number; height: number; } | "Letter" | "A4" | "A5" | "A6"

Defines the size of the document pages. Can be custom dimensions or standard sizes (‘Letter’, ‘A4’, ‘A5’, ‘A6’).


optional pageMargins: object

Defines the margins of the document pages.

left: number

right: number

bottom: number

top: number

optional header: number

optional footer: number