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

Support for pdf/a pdf formats in merging pdfs #117

Open
jaslam-ca opened this issue Jun 29, 2023 · 2 comments
Open

Support for pdf/a pdf formats in merging pdfs #117

jaslam-ca opened this issue Jun 29, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@jaslam-ca
Copy link

jaslam-ca commented Jun 29, 2023

The library's(new PDFMerger()).add() function throws error "Expected instance of PDFDict, but got instance of undefined" when used with pdf/a files.

Following doesn't work with a pdf/a format:
pdf-a.pdf

npx pdf-merger-cli out.pdf pdf-a.pdf pdf-a.pdf

pdf-a error

Following does work without a pdf/a format:
pdf-woa.pdf

npx pdf-merger-cli out.pdf pdf-woa.pdf pdf-woa.pdf
@jaslam-ca
Copy link
Author

@mojoaxel mojoaxel added the bug Something isn't working label Dec 9, 2023
@biennui1998mu
Copy link

biennui1998mu commented Jun 19, 2024

I met the same issue when using merger.add() to merge some of the files. @jaslam-ca @mojoaxel any idea for this?

  • My code:
const render = async () => {
  const merger = new PDFMerger();

  for (const file of files) {
    console.log("sonnn", file);
    await merger.add(file.file).catch(e => {
      console.log("sonnn", e);
    });
  }

  const mergedPdf = await merger.saveAsBlob();
  const url = URL.createObjectURL(mergedPdf);

  return setPdf(url);
};
  • My error log:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants