NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #3940 most downloaded on npm
Create and modify PDF files with JavaScript
Last release 5 years ago
no release in 18 months
Ships unpredictably
gaps range from 8 days to 9 months
Nearly every release is documented
notes for 41 of 42 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
84 releases · first in 2017
Compute multiline font size for multiline inputs by @milesnash in https://github.com/Hopding/pdf-lib/pull/983
Full Changelog: https://github.com/Hopding/pdf-lib/compare/v1.17.0...v1.17.1
Fix typo in docs (thanks @adrianjost!)
ImageAlignment publicly accessible (thanks @oktapodia!)
PDFDocument.copy() method (thanks @mohamedsalem401!)
P property on widgets created by pdf-lib (thanks @Trapfether!)
PDFPage.scale(), PDFPage.scaleContent(), and PDFPage.scaleAnnotations() methods (thanks @JNK90!)
One column per quarter.
Add getters/setters for all valid ViewerPreferences (thanks @mcshaz!):
ViewerPreferences (thanks @mcshaz!):
PDFTextField.setFontSize(...) method to PDFTextField and other field types (thanks @duffyd!):
Add option to create hidden form fields (thanks @jbeuckm!):
PDFRadioGroup and PDFCheckBox appearance streams:
Fix bug causing incorrect radio group appearance to be generated (thanks @btecu!):
Add options to disable custom font ligatures (thanks @hefler!):
PDFTextField.setImage(...) method (thanks @btecu!):
PDFForm.flatten() method (thanks @btecu!):
Improve PDF-A3 and Factur-X support (thanks @DkDavid!):
Add PDFDocument.addJavaScript method (thanks @brodo!):
PDFDocument.addJavaScript method (thanks @brodo!):
Fix handling of null PDFDict entries:
PDFDict entries:
Nothing published for this version
Fix PDFField.acroField type bug
PDFField.acroField type bugPrint flag on new widget annotations so new fields are printed after being added to a page:
Add APIs to support form creation, filling, and reading:
Examples and documentation: * https://github.com/Hopding/pdf-lib#create-form * https://github.com/Hopding/pdf-lib#fill-form * https://github.com/Hopding/pdf-lib#creating-and-filling-forms * https://github.com/Hopding/pdf-lib#fonts-and-unicode
Nothing published for this version
Add rotate option to PDFPage.drawEllipse and PDFPage.drawSvgPath (thanks @soadzoor!)
rotate option to PDFPage.drawEllipse and PDFPage.drawSvgPath (thanks @soadzoor!)
customName option to PDFDocument.embedFont and PDFDocument.embedStandardFont to allow deterministic output from PDFDocument.save (thanks @ztoben and @trevtrich!)
Fix transparent PNG embedding bug (thanks @soadzoor!):
blendMode option to all PDFPage drawing methods (thanks @bockoblur!):
dashArray, dashPhase, borderDashArray, and borderDashPhase options to PDFPage drawing methods to allow control of dashes borders and lines (thanks @soadzoor!):
borderLineCap option to PDFPage drawing methods (thanks @soadzoor!):
Add opacity and borderOpacity options to all page drawing methods (thanks @soadzoor!):
opacity and borderOpacity options to all page drawing methods (thanks @soadzoor!):
objectNumber=0 when parsing:
Add PDFDocument.attach method to add attachments to a document (thanks @sebastinez!):
PDFDocument.attach method to add attachments to a document (thanks @sebastinez!):
Fix PDFPage.drawLine(...) API to remove breaking change introduced in https://github.com/Hopding/pdf-lib/pull/437:
capNumbers: boolean option to PDFDocument.load(...) to allow capping parsed numbers to Number.MAX_SAFE_INTEGER:
PDFPage.drawLine(...) API to remove breaking change introduced in https://github.com/Hopding/pdf-lib/pull/437:
Nothing published for this version
https://github.com/Hopding/pdf-lib/issues/440
Nothing published for this version
Nothing published for this version
Update PDFPage methods for setting width/height/size to handle pages with CropBoxes:
PDFPage methods for setting width/height/size to handle pages with CropBoxes:
PDFObject subclasses to access underlying values:
PDFDocument for reading document metadata (thanks @timKraeuter!):
Fix bug causing parser to fail when parsing empty dictionaries:
Add support for PDF embedding (thanks @tessi!):
Nothing published for this version
Switch PNG decoding library from png-ts to @pdf-lib/upng to support all PNG formats:
png-ts to @pdf-lib/upng to support all PNG formats:
Fix bug causing jumbled text when copying to clipboard in certain PDF readers:
decodePDFRawStream:
addDefaultPage is set to true:
Add option to throw error when invalid objects are parsed (thanks @jwoodrow):
PDFDocument.setLanguage method to set the document's language metadata (thanks @Mogztter):
const enum to support TypeScript projects using the --isolatedModules flag:
Prevent naming conflicts when embedding large numbers of images (Thanks @thebenlamm!):
Resources when normalizing pages:
Add document metadata methods and UTF-16 helpers (thanks @PlushBeaver!):
PDFPage.drawSvgPath(...) method (thanks @jlmessenger!):
Add PDFPage.drawLine(...) method (Thanks @samezyane!):
PDFPage.drawLine(...) method (Thanks @samezyane!):
PDFPage.drawText(...) with maxWidth and wordBreaks options (Thanks @multiplegeorges, @GerardSmit, and @vicary!):
Fix bug causing PDFDocument.getPageCount() to return undefined:
PDFDocument.getPageCount() to return undefined:
This release is a complete rewrite of pdf-lib.
This release is a complete rewrite of pdf-lib.
This rewrite was extensive, touching every part of the library. Here is a high-level overview of the changes and improvements:
Nothing published for this version
Nothing published for this version
Nothing published for this version
Support copying pages with missing Parent entries.
Parent entries.
stream keyword EOLs.
Nothing published for this version
Nothing published for this version
Fix serialization of numbers with large fractional parts. Thanks @mlecoq!
Nothing published for this version
Add sizeOfFontAtHeight methods to font factories.
sizeOfFontAtHeight methods to font factories.
PDFString serialization (remove incorrect escapes).
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Fix existing page normalization bug.
maxObjectNumber when parsing certain object streams.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
PDFDocument.embedFont is now deprecated. Please use PDFDocument.embedNonstandardFont instead.
PDFDocument.embedFont is now deprecated. Please use PDFDocument.embedNonstandardFont instead.drawText() or drawLinesOfText() operators, for example), please be sure to use the font.encodeText() method for the font you are using. This is highly recommended for both standard and nonstandard fonts (and is required if you want to use characters outside the ascii range).font.widthOfTextAtSize() and font.heightOfFontAtSize() methods to measure text, as well as usage of the font.encodeText() method to encode characters outside the ascii range.
Nothing published for this version
Nothing published for this version
Reduce minified bundle size from 1.1 MB to 864.26 KB for a 21% decrease in size. Before and after.
new Function() in dependencies that violate Content Security Policy settings.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Add support for copying pages between different PDF documents. See examples here and here.
Your coding agent can read these notes before it upgrades. Set up the MCP server →