Hopding / pdf-lib

Create and modify PDF documents in any JavaScript environment
https://pdf-lib.js.org
MIT License
6.74k stars 645 forks source link

Cannot print/save as pdf with pdf-lib 1.17.1 #1515

Open oktapodia opened 1 year ago

oktapodia commented 1 year ago

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 image

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

Additional Notes

No response

vipulparmarmt commented 9 months ago

Have you solve it @oktapodia ?

oktapodia commented 9 months ago

Have you solve it @oktapodia ?

Did rollback to 1.16.0 to make it work :/

wael7721 commented 9 months ago

facing the same issue here

blikblum commented 9 months ago

Do you have a minimal working reproduction code? The OP example is not runnable

wael7721 commented 9 months ago

I just deleted everything and im currently trying another library better suited for the project I’am doing. Sorry 🙁

Get Outlook for iOShttps://aka.ms/o0ukef


From: Luiz Américo @.> Sent: Thursday, December 7, 2023 5:40:53 PM To: Hopding/pdf-lib @.> Cc: Wael Farhat @.>; Comment @.> Subject: Re: [Hopding/pdf-lib] Cannot print/save as pdf with pdf-lib 1.17.1 (Issue #1515)

Do you have a minimal working reproduction code? The OP example is not runnable

— Reply to this email directly, view it on GitHubhttps://github.com/Hopding/pdf-lib/issues/1515#issuecomment-1845675140, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APVDMZPEVBUOZWSAF3CNNFLYIHWRLAVCNFSM6AAAAAA34W3BOCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBVGY3TKMJUGA. You are receiving this because you commented.Message ID: @.***>