
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
pdf-password
Advanced tools
Encrypt, Decrypt and Compress PDF files using Ghostscript
npm install pdf-password
You can also install pdf-password with pnpm, yarn, or slnpm
import { compressPDF, decryptPDF, encryptPDF } from 'pdf-password'
await compressPDF({
inFile: 'res/raw.pdf',
outFile: 'res/compressed.pdf',
})
await encryptPDF({
inFile: 'res/raw.pdf',
outFile: 'res/encrypted.pdf',
ownerPassword: 'DemoOwnerPassword',
userPassword: 'DemoUserPassword',
})
await decryptPDF({
inFile: 'res/encrypted.pdf',
outFile: 'res/decrypted-user.pdf',
password: 'DemoUserPassword',
})
await decryptPDF({
inFile: 'res/encrypted.pdf',
outFile: 'res/decrypted-owner.pdf',
password: 'DemoOwnerPassword',
})
Core Functions:
export function decryptPDF(options: {
inFile: string
outFile: string
password: string
}): Promise<void>
export function encryptPDF(
options: {
inFile: string
outFile: string
} & (
| {
ownerPassword: string
userPassword: string
}
| {
password: string
}
),
): Promise<void>
export function compressPDF(options: {
inFile: string
outFile: string
}): Promise<void>
Error Class:
export class PDFError extends Error {
code: number | null
stdout: string
stderr: string
}
This project is licensed with BSD-2-Clause
This is free, libre, and open-source software. It comes down to four essential freedoms [ref]:
FAQs
Encrypt, Decrypt and Compress PDF files using Ghostscript
We found that pdf-password demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.