@jsreport/pdfjs
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -48,3 +48,3 @@ const PDFName = require('./name') | ||
let val = this.dictionary[key] | ||
if (val instanceof PDFString) { | ||
if (val instanceof PDFString || val instanceof PDFDictionary) { | ||
val = val.toString(encryptionFn) | ||
@@ -51,0 +51,0 @@ } |
{ | ||
"name": "@jsreport/pdfjs", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -769,2 +769,14 @@ const { Document, External } = require('../') | ||
it('encrypt should password protect nested dictionaries', async () => { | ||
const document = new Document() | ||
const external = new External(fs.readFileSync(path.join(__dirname, 'nested-dictionary.pdf'))) | ||
document.append(external) | ||
document.encrypt({ | ||
password: 'password', | ||
ownerPassword: 'password' | ||
}) | ||
const pdfBuffer = await document.asBuffer() | ||
pdfBuffer.toString().should.not.containEql('https://jsreport.net') | ||
}) | ||
it('should sign', async () => { | ||
@@ -771,0 +783,0 @@ const document = new Document() |
6293
2079780
64