deno.land / x / docx@8.5.0 / demo / 78-thai-distributed.ts

78-thai-distributed.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Simple example to add text to a document
import * as fs from "fs";import { AlignmentType, Document, Packer, Paragraph, TextRun } from "docx";
const doc = new Document({ sections: [ { properties: {}, children: [ new Paragraph({ alignment: AlignmentType.THAI_DISTRIBUTE, children: [ new TextRun({ text: "บริษัท บิสกิด จำกัด (บริษัทฯ) ได้จดทะเบียนจัดตั้งขึ้นเป็นบริษัทจำกัดตามประมวลกฎหมายแพ่งและพาณิชย์ของประเทศไทย เมื่อวันที่ 30 พฤษภาคม 2561 ทะเบียนนิติบุคคลเลขที่ 0845561005665", size: 36, }), ], }), ], }, ],});
Packer.toBuffer(doc).then((buffer) => { fs.writeFileSync("My Document.docx", buffer);});
docx

Version Info

Tagged at
4 months ago