fix libs location in test-run,add jpeg png support

This commit is contained in:
Sorawit Bholsithi 2023-10-10 00:23:42 +07:00
parent 8c3790bead
commit e43fabb216
14 changed files with 68 additions and 10 deletions

View file

@ -2,12 +2,12 @@
// npx ts-node docx-templates.ts
import * as readline from 'node:readline/promises'; // This uses the promise-based APIs
import { stdin as input, stdout as output } from 'node:process';
import { docxTemplateX} from '../src/libs/docx-templates-lib';
import {templateData} from '../src/libs/report-template'
import { docxTemplateX} from '../libs/docx-templates-lib';
import {templateData} from '../libs/report-template'
import fs from 'fs';
(async ()=>{
const rl = readline.createInterface({ input, output });
const e = await rl.question('Output extension(docx,pdf,odt): ');
const e = await rl.question('Output extension(docx,pdf,odt,png,jpeg): ');
const ext =e?e:"docx"
const dpath = await rl.question('JSON data path(./docx.json): ');
const datapath = dpath?dpath:"./docx.json"

BIN
test-run/report-docx.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
test-run/report-docx.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

BIN
test-run/report-xlsx.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

BIN
test-run/report-xlsx.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

View file

@ -2,12 +2,12 @@
// npx ts-node xlsx-template.ts
import * as readline from 'node:readline/promises'; // This uses the promise-based APIs
import { stdin as input, stdout as output } from 'node:process';
import {xlsxTemplateX} from '../src/libs/xlsx-template-lib'
import {templateData} from '../src/libs/report-template'
import {xlsxTemplateX} from '../libs/xlsx-template-lib'
import {templateData} from '../libs/report-template'
import fs from 'fs';
(async ()=>{
const rl = readline.createInterface({ input, output });
const e = await rl.question('Output extension(xlsx,pdf,ods): ');
const e = await rl.question('Output extension(xlsx,pdf,ods,png,jpeg): ');
const ext =e?e:"xlsx"
const dpath = await rl.question('JSON data path(./xlsx.json): ');
const datapath = dpath?dpath:"./xlsx.json"