All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Fixed footer position after changing it #283
- Fixed graphical state not reset hwen using templates (could lead to rotated/translated pages) #287
- Added support for multiple table header rows #293
- Fixed error when rendering page headers close to the bottom of the page #213
- Fixed reading PDF
Filter
property when being of type array #268
- Fixed images not adding page break
- Fixed PDF name parsing to accept empty names (
/
) #260
- Allow any whitespace in object streams (while parsing PDFs) #253
- Fix main field for jsDelivr #256
- Fixed escape logic of PDF names #252
- Updated PDF parser to ignore comments
- Reverted the broken change made in
2.4.0
- sorry for that!
Unpublished.
- Corrected how text is encoded to the PDF
- Fixed
Lexer is not defined
error when parsing a hex string #215 - Added an error when multiple headers are added to a table #213
- Updated PDF parser to be more forgiving to out of place whitespace in PDF files
- Update PDF parser to accept whitespace before
endstream
keywords - Update PDF parser to ignore trailer prev pointers that point to the document beginning (offset =
0
)
- allow any whitespace between obj version and rev numbers when parsing PDF (fixes parsing of some PDF)
- trim whitespace before starting to parse a PDF object (fixes parsing of MS print to PDF documents)
- fix color space of embedded grayscale JPEGs #210
- fix possible
lexer.isWhiteSpace is not a function
errors when parsing PDFs - fix table header position when rendered right after page header #202
- include
ExtGState
andShading
resources from external PDFs when adding them as templates - fix various table page break issues #191
- fix
text.br()
s not being added if a page break happens right at their position #159 - fix font opts inheritance when creating a text object from a text object (
.text('...').text('...')
) #175 - fix various EOL and
undefined
props errors when parsing existing PDFs - extend
Font.isFont
check to accept fonts that are not an instance ofFont
, but still provide the expected font methods #182
- Fix using pages documents with nested /Pages objects as templates #150
- add missing font type definitions #153
- setTemplate now accepts an second optional parameter indicating whether the templates is to used for the first page only #126
- Pages from external documents should always be added with their original size #111
- Fix parsing documents with nested /Pages objects #117
- Fix parsing multi-line PDF strings #117
opentype.js
has been updated to0.11.0
, which has a minor effect on kerning distances
end
option fordoc.asBuffer
#118
- When providing less cells than a row has columns, instead of throwing, autofill the row with empty cells #101
- Vertical table border in combinaton with colspan #100
- Fix cyclic loop when parsing PDFs with TOCs #112
- Fix to, when adding other PDFs (either as image or whole pages), add objects only once #109
- Fix parsing of escaped characters in strings #114
Version 2.0.0
is a re-write. The implementation is expected to settle with the current approach of streaming layouting with smart content chunking, which allows for having a small memory footprint even when creating a PDF document with thousands of pages.
2.0.0
requires Node >= 7. If you get an error on require('pdfjs')
you are probably using an older Node.js version, which can be fixed by updating Node.js or by running pdfjs through a transpiler like babel.
- The outline method now accepts an outline ID (number) as a valid input for the parent parameter
- Fixed OTF font browser usage (
new Font(src)
now properly accepts both Node.js Buffer and ArrayBuffer as input)
- Document outline support
- creating AFM fonts from JSON (
new Font(require('pdfjs/font/Helvetica.json'))
- instead, load the font directly:require('pdfjs/font/Helvetica')
)
- creating AFM fonts is deprecated
new Font(require('pdfjs/font/Helvetica.json'))
, instead load instances directlyrequire('pdfjs/font/Helvetica')
- Added type definitions for TypeScript #91
- Added support for parsing Object Streams
- Expose Document class instead an anonymous class #92
- Improved ergonomics of loading AFM fonts (
require('pdfjs/font/Helvetica')
instead ofnew Font(require('pdfjs/font/Helvetica.json'))
) - The
font
option when creating anew Document
is now optional and defaults to Helvetica
- Tests should now run on windows #78
- fix kerning for OTF fonts #84
- implement font kerning (with a minor limitation)
- fixed PDF text not being printed when using macOS print dialog #83 (as a consequence, set PDF version of documents to 1.6)
- fix combination of multiple TTF/OTF fonts in one line #81
- Text decoration underline and strikethrough
- fix font re-use to not include glyphs from other documents