Need example for working with encryption
manojhl opened this issue · 2 comments
manojhl commented
I'm able to generate pdf files without encryption, but when I give the encrypt option its not creating a encrypted pdf.
Prince({"encrypt": true}, "key-bits": 128, "user-password": "12345")
.inputs("sample.html")
.output("tax/test-"+count+".pdf")
.execute()
.then(function () {
console.log("OK: done");
}, function (error) {
console.log("ERROR: ", util.inspect(error));
})
Guess need some examples and documentation on how to use options
rse commented
There are no second and third paramater to the Prince constructor. You have to use the "option" method to pass the prince(1) CLI options:
Prince()
.option("encrypt", true)
.option("key-bits", 128)
.option("user-password", "12345")
.inputs("sample.html")
.output("tax/test-"+count+".pdf")
.execute()
.then(function () {
console.log("OK: done");
}, function (error) {
console.log("ERROR: ", util.inspect(error));
})
manojhl commented
oh, my bad. But wouldn't it be nice if we can provide multiple
parameters(options) via Prince() constructor. Anyway thanks for pointing it
out.
On Wed, Aug 26, 2015 at 11:29 PM, Ralf S. Engelschall <
notifications@github.com> wrote:
—
Reply to this email directly or view it on GitHub
#4 (comment).
Manoj H L
Freelancer
Web Developer @ Greenpeace India Society