diff --git a/package.json b/package.json index 2ae3f06d..e961df66 100644 --- a/package.json +++ b/package.json @@ -170,6 +170,7 @@ "fuse.js": "^7.1.0", "generate-schema": "^2.6.0", "get-timezone-offset": "^1.0.5", + "ghostscript-wasm-esm": "^1.0.1", "gtin-validator": "^1.0.0", "hash-wasm": "^4.12.0", "haversine": "^1.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f44b5100..eaeb0e1e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -398,6 +398,9 @@ importers: get-timezone-offset: specifier: ^1.0.5 version: 1.0.5 + ghostscript-wasm-esm: + specifier: ^1.0.1 + version: 1.0.1 gtin-validator: specifier: ^1.0.0 version: 1.0.0 @@ -6986,6 +6989,9 @@ packages: getpass@0.1.7: resolution: {integrity: sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==} + ghostscript-wasm-esm@1.0.1: + resolution: {integrity: sha512-b4/nIROy6hygl9IWjIrwaaPo83ziUClo+1QOdHM0zjxOZ1QyfIrCR7EWW8HJO1GOe68GEBVLBCy9QlkgOGaRFQ==} + gifwrap@0.9.4: resolution: {integrity: sha512-MDMwbhASQuVeD4JKd1fKgNgCRL3fGqMM4WaqpNhWO0JiMOAjbQdumbs4BbBZEy9/M00EHEjKN3HieVhCUlwjeQ==} @@ -18450,6 +18456,10 @@ snapshots: dependencies: assert-plus: 1.0.0 + ghostscript-wasm-esm@1.0.1: + dependencies: + '@types/emscripten': 1.40.1 + gifwrap@0.9.4: dependencies: image-q: 4.0.0 diff --git a/public/gs.wasm b/public/gs.wasm new file mode 100644 index 00000000..dad048cb Binary files /dev/null and b/public/gs.wasm differ diff --git a/src/tools/pdf-compressor/index.ts b/src/tools/pdf-compressor/index.ts new file mode 100644 index 00000000..4ccbeed2 --- /dev/null +++ b/src/tools/pdf-compressor/index.ts @@ -0,0 +1,13 @@ +import { FileZip } from '@vicons/tabler'; +import { defineTool } from '../tool'; + +export const tool = defineTool({ + name: 'PDF Compressor', + path: '/pdf-compressor', + description: 'Optimize and compress PDF using Ghostscript', + keywords: ['pdf', 'optimize', 'compressor'], + component: () => import('./pdf-compressor.vue'), + icon: FileZip, + createdAt: new Date('2025-11-11'), + category: 'PDF', +}); diff --git a/src/tools/pdf-compressor/pdf-compressor.vue b/src/tools/pdf-compressor/pdf-compressor.vue new file mode 100644 index 00000000..be21d263 --- /dev/null +++ b/src/tools/pdf-compressor/pdf-compressor.vue @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + An error occured processing {{ fileName }} + + + + + + + {{ logs.join('\n') }} + + +
{{ logs.join('\n') }}