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

Reading File with Base 14 fonts not embedded in document #385

Open
jasperA256 opened this issue May 16, 2019 · 0 comments
Open

Reading File with Base 14 fonts not embedded in document #385

jasperA256 opened this issue May 16, 2019 · 0 comments

Comments

@jasperA256
Copy link

Summary

I'm trying to read a file that does not have the Base 14 font Helvetica embedded, to merge it to an existing pdf.

Environment

The code is running on a Debian Jessie server
hummus-js -v 1.0.95
node -v 8.15.1

Snippet

try {
    let pdfReader = hummus.createReader(new hummus.PDFRStreamForBuffer(pdfBuffer));
    pdfWriter.appendPDFPagesFromPDF(new hummus.PDFRStreamForBuffer(pdfBuffer));
} catch (e) {
    // Throws 'Unable to start parsing PDF file'
}

where pdfBuffer is a Buffer containing the pdf to be merged.

Info

The (test)pdf I'm trying to merge, causing troubles is the following: https://cdn.a256.eu/test-files/base-14-fonts-not-embedded.pdf
The application handles user-uploaded pdfs, so we don't have control over the pdfs themselves. The user regards the pdf as valid, because all readers handle it fine.

Is there any way the Base 14 fonts can be pre-loaded in hummus to prevent errors like that? Or specified to the reader?

Thanks a lot,
Jasper

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