We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please note that I am using node-qpdf2, but that's just a wrapper around this module.
node-qpdf2
Trying to encrypt a file that has one or more spaces in the name
qpdf .encrypt( '/Users/my/absolute/path/to/A Sample PDF.pdf', { keyLength: 40, password: { user: '', owner: 'YOUR_PASSWORD_TO_ENCRYPT_FOR_OWNER', }, restrictions: { print: 'y', }, }, '/Users/my/absolute/path/to/protected.pdf' ) .then((x) => console.log('Done: ', x)) .catch((e) => console.error('Error: ', e));
Result:
Error: open /Users/my/absolute/path/to/A\ Sample\ PDF.pdf: No such file or directory
I thought that maybe adding double quotes around the path would help, as that is what you do in the shell to allow paths with spaces:
qpdf .encrypt( '"/Users/my/absolute/path/to/A Sample PDF.pdf"', { keyLength: 40, password: { user: '', owner: 'YOUR_PASSWORD_TO_ENCRYPT_FOR_OWNER', }, restrictions: { print: 'y', }, }, '/Users/my/absolute/path/to/protected.pdf' ) .then((x) => console.log('Done: ', x)) .catch((e) => console.error('Error: ', e));
Done: Input file doesn't exist
Using path.resolve also results in the "Input file doesn't exist" error.
path.resolve
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Trying to encrypt a file that has one or more spaces in the name
Result:
I thought that maybe adding double quotes around the path would help, as that is what you do in the shell to allow paths with spaces:
Result:
Done: Input file doesn't exist
Using
path.resolve
also results in the "Input file doesn't exist" error.The text was updated successfully, but these errors were encountered: