Skip to content

Commit

Permalink
Merge pull request #21 from victorsoares96/fix/windows-not-found-gs-m…
Browse files Browse the repository at this point in the history
…odule

🩹 fix: windows not found gs module
  • Loading branch information
victorsoares96 committed Apr 7, 2023
2 parents 57048a6 + 27bd65b commit 2d408bc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { compress } from 'compress-pdf';

(async () => {
const pdf = path.resolve(__dirname, 'A17_FlightPlan.pdf');
const buffer = await compressPdf(pdf);
const buffer = await compress(pdf);

const compressedPdf = path.resolve(__dirname, 'compressed_pdf.pdf');
await fs.promises.writeFile(compressedPdf, buffer);
Expand Down
3 changes: 2 additions & 1 deletion examples/basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import fs from 'fs';
import compressPdf from '@/index';

/**
* After this run:
* Before run:
*
* `npx compress-pdf --fetchBinaries [win32/linux]`
* This will download properly binaries to your current os.
*/
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "compress-pdf",
"version": "0.2.1",
"version": "0.2.2",
"templateVersion": "1.3.0",
"description": "An compress pdf library using ghostscript",
"main": "dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/get-gs-module-path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function getGSModulePath(binPath: string, platform: NodeJS.Platform) {
}

if (platform === 'win32') {
gsModule = path.resolve(binPath, 'bin/gswin64c');
gsModule = path.resolve(binPath, 'bin/gswin64c.exe');
}

if (!fs.existsSync(gsModule)) {
Expand Down

0 comments on commit 2d408bc

Please sign in to comment.