@sylphide/pdf-actions
Version:
A NPM Package built on top of pdf-lib that provides functonalities like merge, rotate, split and many more...
19 lines (14 loc) • 498 B
JavaScript
const { PDFDocument } = require('@cantoo/pdf-lib');
const pdfArray = require('./pdfArray');
const EmptyPDFDocument = async () => await PDFDocument.create();
const PDFDocumentFromFile = async (file) =>
await PDFDocument.load(await pdfArray(file), {
ignoreEncryption: true,
});
const PDFDocumentFromPDFArray = async (fileArray) =>
await PDFDocument.load(fileArray, { ignoreEncryption: true });
module.exports = {
EmptyPDFDocument,
PDFDocumentFromFile,
PDFDocumentFromPDFArray,
};