CreateDocumentFromPlaintextOptions
CreateDocumentFromPlaintextOptions:
{}Options for creating documents from plain text.
Examples
Section titled “Examples”// Create document with default page settingsconst doc = await system.createDocumentFromPlaintext('Hello World');// Create document with standard page sizeconst 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 marginsconst 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 textconst 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.
Properties
Section titled “Properties”pageSize?
Section titled “pageSize?”
optionalpageSize: {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’).
pageMargins?
Section titled “pageMargins?”
optionalpageMargins:object
Defines the margins of the document pages.
left:
number
right:
number
bottom
Section titled “bottom”bottom:
number
top:
number
header?
Section titled “header?”
optionalheader:number
footer?
Section titled “footer?”
optionalfooter:number