Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceError: File is not defined #4

Open
stevebaldwin21 opened this issue Aug 18, 2018 · 0 comments
Open

ReferenceError: File is not defined #4

stevebaldwin21 opened this issue Aug 18, 2018 · 0 comments

Comments

@stevebaldwin21
Copy link

A reference error is thrown when attempting to save the pdf assembly without having filesaver.

const PDFAssembler = require('pdfassembler').PDFAssembler;

async function main() {
    var pdf = new PDFAssembler("receipt.pdf");
    var structure = await pdf.getPDFStructure();

    structure['/Root']['/Pages']['/Kids'][0]['/Contents'] = [{
        'stream': "1 0 0 1 72 708 cm BT /Helv 12 Tf (Hello world!) Tj ET"
    }];

    // ReferenceError: File is not defined
    pdf.assemblePdf("output.pdf");
}
main();

Possibly add it as a dependency?

Awesome lib though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant