pdf-lib
pdf-lib copied to clipboard
Cannot print/save as pdf with pdf-lib 1.17.1
What were you trying to do?
I can generate my pdf (which includes forms, images, embedded fonts and metadata), but it seems to be impossible to save/print it afterwards because of the following errors
How did you attempt to do it?
Rollbacking to version 1.16.0 seems to fix the issue
What actually happened?
I guess that some metadata are not correctly generated
What did you expect to happen?
being able to print/save with versions above 1.16.0
How can we reproduce the issue?
Assigning metadata with:
function generatePDFMetaData(projectInfo: ProjectInfo): ICreatePDFOptions['metaValues'] {
return {
title: projectInfo.title || 'New title',
author: `Author`,
creator: `Creator`,
producer: `Producer`,
creationDate: projectInfo.createdAt,
modificationDate: projectInfo.modifiedAt,
keywords: [],
subject: 'Subject',
}
}
for (const [key, value] of Object.entries(generatePDFMetaData(projectInfo)) {
pdf[`set${upperFirst(key)}`](value)
}
Version
1.17.1
What environment are you running pdf-lib in?
Browser
Checklist
- [X] My report includes a Short, Self Contained, Correct (Compilable) Example.
- [X] I have attached all PDFs, images, and other files needed to run my SSCCE.
Additional Notes
No response