import {Document} from 'npdf'
const doc = new Document('/path/to/file')
const pageCount = doc.getPageCount()
const page = doc.getPage(0) // pages are zero indexed
const mergeDocs = doc.mergeDocument('/path/to/other/doc')
doc.setPassword('secret')
doc.write('/file/destination')
const fileBuffer = fs.readFile('/file/destination', (e,d) => e ? e : d)
// do something with the file or the file buffer
Document
import {Document} from 'npdf' const doc = new Document('/path/to/file') const pageCount = doc.getPageCount() const page = doc.getPage(0) // pages are zero indexed const mergeDocs = doc.mergeDocument('/path/to/other/doc') doc.setPassword('secret') doc.write('/file/destination') const fileBuffer = fs.readFile('/file/destination', (e,d) => e ? e : d) // do something with the file or the file buffer