question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@jerp @gregbacchus @mlecoq @kevinswartz @Jonathan-Mckenzie @philipjmurphy @DanielJackson-Oslo @matthopson @ithillel-aminev @vitaly-zdanevich

Hello everybody! Today I’m excited to announce the beta release of pdf-lib v1.0.0!

You have all provided extremely valuable feedback on pdf-lib over the past year. This feedback has highlighted several architectural flaws in the design of pdf-lib (e.g. the inability to load invalid PDFs). It has also brought to my attention some critical shortcomings in pdf-lib’s feature set (e.g. no methods for getting the width/height of a page).

I’ve responded to these issues with specific workarounds and fixes as they’ve been reported. But I’ve also been thinking about how to solve them in a more wholistic way.

With this goal in mind, I’ve been hard at work these past few months working on a complete rewrite of pdf-lib. This rewrite is now mostly complete. All that remains is to write documentation and implement a few small features.

I’d like to ask for your help in beta testing this rewrite. I’ve written extensive automated and manual tests, and have verified that everything works in all major PDF readers (Acrobat, Foxit, Preview) and browsers (Chrome, Firefox, Safari). But since this rewrite is so extensive, I do not want to do a full release until others have been able to test it.


I’m working on a complete changelog, but it might be a week or two until I am able to complete it. So, in the meantime, here’s a list of the main changes/improvements in v1.0.0:

  • A new high level API
  • Much faster parser
  • More robust parser
  • Smaller bundle size (you must now opt-in to using fontkit if you use custom fonts)
  • Better handling of encrypted documents
  • Improved automated test coverage
  • Improved manual test coverage

The README for the rewrite can be found here: https://github.com/Hopding/pdf-lib/tree/Rewrite.

You can install the beta version of v1.0.0 with npm:

npm install --save pdf-lib@beta

or yarn:

yarn add pdf-lib@beta

It’s also available on the unpkg CDN:


Those of you that intend to participate in this beta test, please post a comment in this thread to let me know! If you do not plan to participate, please just ignore this (I understand that not everybody will be able to participate).

I’d like to keep all issues and discussion pertaining to the beta test centralized in this thread. However, if you need to communicate privately with me, please feel free to email me at andrew.dillon.j@gmail.com.

I appreciate your help and am looking forward to a successful release of v1.0.0!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:32 (20 by maintainers)

github_iconTop GitHub Comments

4reactions
Hopdingcommented, Jul 23, 2019

Hello again everybody! I’ve just finished creating a project site for pdf-lib: https://pdf-lib.js.org/. This site also includes API docs for v1.0.0: https://pdf-lib.js.org/docs/api/ (this should be of interest to you @thommath). I’d greatly appreciate everybody’s feedback on the site and the API docs.

Also, I’m planning to close out the beta test in a week or so unless any issues are discovered. Once I close out beta, I’ll switch the master branch to track Rewrite and cut the official v1.0.0 release! Thanks again to everybody for helping test things out.

4reactions
Hopdingcommented, Jul 9, 2019

@cjblb19 It sounds like you are having two distinct issues:

  • You’re able to merge PDFs without any errors, but the resulting mergedPdf only contains a single blank page
  • You’re unable to load certain PDFs due to an encryption error

Is this summary correct?


I looked at the PDF file you shared, and it is actually encrypted. You can verify this with Acrobat Reader:

Screen Shot 2019-07-08 at 8 19 51 PM

This is understandably confusing. After all, how can a document be encrypted if you’re able to open it in your browser without entering a password? You can do this because the PDF specification actually defines a default password:

Screen Shot 2019-07-08 at 8 24 47 PM

This default password is what Chrome (and other readers) use to decrypt the PDF - thus allowing you to view an encrypted PDF without entering a password.

Encrypted documents are one of pdf-lib’s weak points. It turns out that there are a lot more encrypted PDFs out there than you might think. But you’d never know, because many of them use this default password. Support for PDF decryption is high on my list of features/enhancements. However, I do not plan to include it in the v1.0.0 release.


If anybody would like to work with me to help add support for PDF decryption to pdf-lib, I’d greatly appreciate it! There’s lots of work that can be done to make pdf-lib even better than it already is. But the pace of feature development currently depends primarily on how much time I have available to devote to it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Semantic Versioning 1.0.0-beta
In systems with many dependencies, releasing new package versions can quickly become a nightmare. If the dependency specifications are too tight, you are...
Read more >
v1.0.0-beta.6 - Meraki Portal What's New & Changelog
Creates new quality retention profile for this network. POST /networks/{networkId}/camera/qualityRetentionProfiles · Update an existing quality retention profile ...
Read more >
v1.0.0-beta.34 - GitHub
No information is available for this page.
Read more >
conventional commit messaging - Conventional Commits
Conventional Commits 1.0.0-beta.2 · Commit message with description and breaking change in body · Commit message with no body · Commit message with...
Read more >
Announcing Vendure v1.0.0-beta
It is with great excitement that we announce the release of Vendure v1.0.0-beta.1! This is the first release of the v1.0 pre-release phase, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found