tambahannnya
This commit is contained in:
11
xcoba.ts
Normal file
11
xcoba.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
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);
|
||||
})();
|
||||
Reference in New Issue
Block a user