{"_id":"node-qpdf","_rev":"6-01a9f687b11b330e3a16f47861a16aac","name":"node-qpdf","description":"A Content Preserving transformations on PDFs wrapped around QPDF","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"node-qpdf","version":"1.0.0","description":"A Content Preserving transformations on PDFs wrapped around QPDF","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/nrhirani/node-qpdf.git"},"keywords":["pdf","password protect","encrypt","dcrypt","aes","rc4","aes-256","aes-128","rc4-128","rc4-40"],"author":{"name":"Nishit Hirani","email":"nrhirani@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/nrhirani/node-qpdf/issues"},"homepage":"https://github.com/nrhirani/node-qpdf#node-qpdf","gitHead":"5cda428e03f851c843a4e298bbd527874006dca0","_id":"node-qpdf@1.0.0","_shasum":"1c1ae79911a6e5ce9d6f8218b88b9ce4f7d2d5fb","_from":".","_npmVersion":"3.8.8","_nodeVersion":"0.10.26","_npmUser":{"name":"nrhirani","email":"nrhirani@gmail.com"},"dist":{"shasum":"1c1ae79911a6e5ce9d6f8218b88b9ce4f7d2d5fb","tarball":"https://registry.npmjs.org/node-qpdf/-/node-qpdf-1.0.0.tgz","integrity":"sha512-QiIQYAH0YYBlRG75kAh9uMFVoGeoZ0NGB5pIzmSNBX1sWOe5JlTKBTLtrkoneU7FD0RFjByjaTrIDkFCSib+pg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGUDisf9HnBUmfOYo7XEDkf5XiYF3WjMMEUXg3cLOJi/AiAtjR2+z9vrR9sr0gx+sGqswP7iIvJZb0NY3yVlAI7A0A=="}]},"maintainers":[{"name":"nrhirani","email":"nrhirani@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/node-qpdf-1.0.0.tgz_1462103209333_0.34468143503181636"}},"1.0.1":{"name":"node-qpdf","version":"1.0.1","description":"A Content Preserving transformations on PDFs wrapped around QPDF","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/nrhirani/node-qpdf.git"},"keywords":["pdf","qpdf","password protect","password protect pdf","pdf encryption","pdf decryption","encrypt","dcrypt","aes","rc4","aes-256","aes-128","rc4-128","rc4-40"],"author":{"name":"Nishit Hirani","email":"nrhirani@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/nrhirani/node-qpdf/issues"},"homepage":"https://github.com/nrhirani/node-qpdf#node-qpdf","gitHead":"c62739d00bf74fdd15e91db216ca6a8edf335ac5","_id":"node-qpdf@1.0.1","_shasum":"3d0b48e2f0714aa7d9c78ec08e3a948e6ff228b2","_from":".","_npmVersion":"3.8.8","_nodeVersion":"0.10.26","_npmUser":{"name":"nrhirani","email":"nrhirani@gmail.com"},"dist":{"shasum":"3d0b48e2f0714aa7d9c78ec08e3a948e6ff228b2","tarball":"https://registry.npmjs.org/node-qpdf/-/node-qpdf-1.0.1.tgz","integrity":"sha512-E1nM0sXxRvgoIodXcf7OAYYPtcLMr3eOpd5JrfYYdOVVF5NwCTHL1th2kCRaQJyS5AdgAr1QuiC9L+5HGxXAFg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAl9WvR53A3qSH4WCM/MaKgwcKd+f3nXo/0Qv4VZdeEkAiEA9RU32WwGdvPSqpTZ9qZ4NPQtMmh8m6RZpQj7wSuuiOE="}]},"maintainers":[{"name":"nrhirani","email":"nrhirani@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/node-qpdf-1.0.1.tgz_1462104294272_0.3722722365055233"}},"1.0.2":{"name":"node-qpdf","version":"1.0.2","description":"A Content Preserving transformations on PDFs wrapped around QPDF","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/nrhirani/node-qpdf.git"},"keywords":["pdf","qpdf","password protect","password protect pdf","pdf encryption","pdf decryption","encrypt","dcrypt","aes","rc4","aes-256","aes-128","rc4-128","rc4-40"],"author":{"name":"Nishit Hirani","email":"nrhirani@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/nrhirani/node-qpdf/issues"},"homepage":"https://github.com/nrhirani/node-qpdf#node-qpdf","gitHead":"e63900a43dbfed1fa6ee3474c8ee2cf48692234a","_id":"node-qpdf@1.0.2","_shasum":"bae66b152fd8a6a6b48f6c97298b78e14b0913a0","_from":".","_npmVersion":"3.8.8","_nodeVersion":"0.10.26","_npmUser":{"name":"nrhirani","email":"nrhirani@gmail.com"},"dist":{"shasum":"bae66b152fd8a6a6b48f6c97298b78e14b0913a0","tarball":"https://registry.npmjs.org/node-qpdf/-/node-qpdf-1.0.2.tgz","integrity":"sha512-Fwe5EWM5C+M6Lq4he2KyfuFJawLsE2qc9Ywo9qIF/hg2i0pYxhQVsfwq5JXR0FrXFH2Re4YIouehnq6To2H9YQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2Kwj4odn46UHRYpDSpYUiFmE4bpbRv5yMCpC6oXISNQIgD1Bdoojbyk7Xte5sjcEzCD8XEr3I9/dRZSlBNYhwoqo="}]},"maintainers":[{"name":"nrhirani","email":"nrhirani@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/node-qpdf-1.0.2.tgz_1466921292077_0.7910449616611004"}},"1.0.3":{"name":"node-qpdf","version":"1.0.3","description":"A Content Preserving transformations on PDFs wrapped around QPDF","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/nrhirani/node-qpdf.git"},"keywords":["pdf","qpdf","password protect","password protect pdf","pdf encryption","pdf decryption","encrypt","dcrypt","aes","rc4","aes-256","aes-128","rc4-128","rc4-40"],"author":{"name":"Nishit Hirani","email":"nrhirani@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/nrhirani/node-qpdf/issues"},"homepage":"https://github.com/nrhirani/node-qpdf#node-qpdf","gitHead":"db38d13c761506b7baa5262ed555a8bdee554888","_id":"node-qpdf@1.0.3","_shasum":"29cdb3ff58f67aa14664afcfa59c44097fa677e2","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.1.0","_npmUser":{"name":"nrhirani","email":"nrhirani@gmail.com"},"dist":{"shasum":"29cdb3ff58f67aa14664afcfa59c44097fa677e2","tarball":"https://registry.npmjs.org/node-qpdf/-/node-qpdf-1.0.3.tgz","integrity":"sha512-M1Y5+7Ycm93Uwd7MhLUVTzRUTgHGiPiqjdYqNYoma9WGuiVvzwQ8EeyBKKwVbu3fK83lDxUBf+GX8G0S9Nx8ew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3HJG5NNfaleLVaZENlpZvkuFM0Ol3h2DtRME4kScY8gIhAJXlsvcD/sxiw1cBDJzY/LvjyzxYG65hXCJ4VnZYm/EG"}]},"maintainers":[{"name":"nrhirani","email":"nrhirani@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-qpdf-1.0.3.tgz_1516706555048_0.27442331914789975"}}},"readme":"# node-qpdf\n[![npm version](https://badge.fury.io/js/node-qpdf.svg)](https://badge.fury.io/js/node-qpdf) [![NPM Downloads](https://img.shields.io/npm/dt/node-qpdf.svg)](https://www.npmjs.com/package/node-qpdf) [![NPM Downloads](https://img.shields.io/npm/dm/node-qpdf.svg)](https://www.npmjs.com/package/node-qpdf) [![bitHound Code](https://www.bithound.io/github/nrhirani/node-qpdf/badges/code.svg)](https://www.bithound.io/github/nrhirani/node-qpdf) [![bitHound Overall Score](https://www.bithound.io/github/nrhirani/node-qpdf/badges/score.svg)](https://www.bithound.io/github/nrhirani/node-qpdf)\n\nA very simple wrapper for [qpdf](http://qpdf.sourceforge.net/) which is a content-preserving transformations on PDF files. It includes encrypting and decrypting PDF with AES 256, AES 128, RC4 (128 & 40) encryption algorithms.\n\n## Dependencies\n* [Node.js](http://nodejs.org/)\n* [qpdf](http://qpdf.sourceforge.net/)\n\n## Installation\n1. Install qpdf:\n    * Download [qpdf](https://sourceforge.net/projects/qpdf/files/qpdf/6.0.0/)\n    * Read [qpdf manual](http://qpdf.sourceforge.net/files/qpdf-manual.html#ref.building) for installation instructions.\n2. Install node-qpdf:\n    ```\n    npm install node-qpdf\n    ```\n\n## Encryption\nYou can encrypt your PDF by following:\n```\nvar qpdf = require('node-qpdf');\n\nvar options = {\n    keyLength: 128,\n    password: 'YOUR_PASSWORD_TO_ENCRYPT'\n}\n\nqpdf.encrypt(localFilePath, options);\n```\n\n### Options for Encryption\nThe following are **required options**\n* `keyLength:` - a number which defines the encryption algorithm to be used. Values can be **40, 128 and 256** only.\n* `password:` - a string containing the secret password which will be further used to unlock the PDF.\n\nYou might want to set other options for each encryption algorithm inside `restrictions:` JSON according to the `keyLength` you choose :-\n\n*Key Length:* **40**\n\n| Option | Value | Description |\n|:---|:---|:---|\n`print:` | `'y'`, `'n'` | Determines whether or not to allow printing.\n`modify:` | `'y'`, `'n'` | Determines whether or not to allow document modification.\n`extract:` | `'y'`, `'n'` | Determines whether or not to allow text/image extraction.\n`annotate:` | `'y'`, `'n'` | Determines whether or not to allow comments and form fill-in and signing.\n\n*Key Length:* **128**\n\n| Option | Value | Description |\n|:---|:---|:---|\n`print:` | `'full'`, `'low'`, `'none'` | **full**: allow full printing. **low**: allow low-resolution printing only. **none**: disallow printing.\n`modify:` | `'all'`, `'annotate'`, `'form'`, `'assembly'`, `'none'` | **all:** allow full document modification. **annotate:** allow comment authoring and form operations. **form:** allow form field fill-in and signing. **assembly:** allow document assembly only. **none:** allow no modifications.\n`extract:` | `'y'`, `'n'` | Determines whether or not to allow text/image extraction.\n`useAes:` | `'y'`, `'n'` | AES encryption will be used instead of RC4 encryption.\n`accessibility:` | `'y'`, `'n'` | Determines whether or not to allow accessibility to visually impaired.\n\n*Key Length:* **256**\n\n| Option | Value | Description |\n|:---|:---|:---|\n`print:` | `'full'`, `'low'`, `'none'` | **full**: allow full printing. **low**: allow low-resolution printing only. **none**: disallow printing.\n`modify:` | `'all'`, `'annotate'`, `'form'`, `'assembly'`, `'none'` | **all:** allow full document modification. **annotate:** allow comment authoring and form operations. **form:** allow form field fill-in and signing. **assembly:** allow document assembly only. **none:** allow no modifications.\n`extract:` | `'y'`, `'n'` | Determines whether or not to allow text/image extraction.\n`accessibility:` | `'y'`, `'n'` | Determines whether or not to allow accessibility to visually impaired.\n\n### Examples\n#### Render and Save:\n```\nvar qpdf = require('node-qpdf');\n\nvar options = {\n    keyLength: 128,\n    password: 'YOUR_PASSWORD_TO_ENCRYPT',\n    restrictions: {\n        print: 'low',\n        useAes: 'y'\n    }\n}\n\nqpdf.encrypt(localFilePath, options, outputFilePath);\n```\n#### Render and Stream:\n```\nvar qpdf = require('node-qpdf');\n\nvar options = {\n    keyLength: 256,\n    password: 'YOUR_PASSWORD_TO_ENCRYPT',\n    restrictions: {\n        modify: 'none',\n        extract: 'n'\n    }\n}\n\nvar doc = qpdf.encrypt(localFilePath, options, outputFilePath);\n\ndoc.stdout.pipe(res);\n\nres.writeHead(200, {\n    'Content-Type': 'application/pdf',\n    'Access-Control-Allow-Origin': '*',\n    'Content-Disposition': 'inline; filename=order.pdf'\n});\n```\n\n## Decryption\nYou can decrypt your PDF by following:\n```\nvar qpdf = require('node-qpdf');\n\nqpdf.decrypt(localFilePath, 'YOUR_PASSWORD_TO_DECRYPT_PDF');\n```\n\n### Examples\n#### Render and Save:\n```\nvar qpdf = require('node-qpdf');\n\nqpdf.decrypt(localFilePath, 'YOUR_PASSWORD_TO_DECRYPT_PDF', outputFilePath);\n```\n#### Render and Stream:\n```\nvar qpdf = require('node-qpdf');\n\nvar doc = qpdf.decrypt(localFilePath, 'YOUR_PASSWORD_TO_DECRYPT_PDF', outputFilePath);\n\ndoc.stdout.pipe(res);\n\nres.writeHead(200, {\n    'Content-Type': 'application/pdf',\n    'Access-Control-Allow-Origin': '*',\n    'Content-Disposition': 'inline; filename=order.pdf'\n});\n```\n\n## Meta\n\nMaintained by [Nishit Hirani](http://www.twitter.com/nrhirani)\n\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/nrhirani/node-qpdf.\n\n\n## License\n\nThe npm package is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","maintainers":[{"name":"nrhirani","email":"nrhirani@gmail.com"}],"time":{"modified":"2022-06-21T18:29:26.541Z","created":"2016-05-01T11:46:49.726Z","1.0.0":"2016-05-01T11:46:49.726Z","1.0.1":"2016-05-01T12:04:54.664Z","1.0.2":"2016-06-26T06:08:15.850Z","1.0.3":"2018-01-23T11:22:36.908Z"},"homepage":"https://github.com/nrhirani/node-qpdf#node-qpdf","keywords":["pdf","qpdf","password protect","password protect pdf","pdf encryption","pdf decryption","encrypt","dcrypt","aes","rc4","aes-256","aes-128","rc4-128","rc4-40"],"repository":{"type":"git","url":"git+https://github.com/nrhirani/node-qpdf.git"},"author":{"name":"Nishit Hirani","email":"nrhirani@gmail.com"},"bugs":{"url":"https://github.com/nrhirani/node-qpdf/issues"},"license":"MIT","readmeFilename":"README.md"}