Files
desa-darmasaba/xcoba.ts
bipproduction 2115af8126 tambahannnya
2025-02-15 21:56:18 +08:00

11 lines
349 B
TypeScript

import path from 'path';
import fs from 'fs';
import { compress } from 'compress-pdf';
(async () => {
const pdf = path.resolve("/Users/bip/Downloads", 'komoditas.pdf');
const buffer = await compress(pdf);
const compressedPdf = path.resolve(__dirname, 'compressed_pdf.pdf');
await fs.promises.writeFile(compressedPdf, buffer);
})();