0.6.1 - 2026-03-08
- Upgraded
@ralfstx/pdf-coredependency from 0.1.x to 0.2.x. PDFs now include XMP metadata derived from the document info properties.
- TypeScript declaration files (
.d.ts) for the public API were missing from the published package, breaking type resolution for consumers.
0.6.0 - 2026-02-28
-
Text shaping (ligatures and kerning) is now enabled by default for all text. The following text properties have been added to control shaping behavior:
fontKerning: Controls kerning ('normal'|'none').fontVariantLigatures: Controls ligatures and contextual alternates ('normal'|'none').fontFeatureSettings: Low-level control over OpenType features as aRecord<string, boolean>(e.g.{ smcp: true, tnum: true }).
-
A
languageproperty (BCP 47 tag) on both the document definition and text properties. The document-level language is written to the PDF catalog (for accessibility). Fonts that provide language-specific typographic behavior (e.g. for Turkish or Serbian) will use the correct glyph forms for the specified language.
- Replaced
pdf-libwith@ralfstx/pdf-coreas the underlying PDF generation library. This results in faster PDF generation and a smaller bundle size. It also opens up new possibilities for new features such as font shaping.
-
Support for font and image data as base64-encoded strings and
ArrayBuffer. Data must now be provided asUint8Array. -
The
imagesproperty in the document definition. Images should be referred to by URL instead. TheImagesDefinitionandImageDefinitiontypes have been removed. -
The
fontsproperty in the document definition. Fonts must now be registered withPdfMaker.registerFont(). TheFontsDefinitionandFontDefinitiontypes have been removed. -
The deprecated standalone
makePdffunction. Usenew PdfMaker().makePdf()instead. -
The deprecated
PolylineandPolyLineOptstypes from the graphics API. UsePathinstead. -
The deprecated
boldanditalictext properties. UsefontWeight: 'bold'andfontStyle: 'italic'instead. -
The deprecated type aliases
InfoAttrs,CustomInfoAttrs,LineOpts,RectOpts,CircleOpts,PathOpts,BlockAttrs, andTextAttrs. Use their*Propscounterparts instead.
- The text height is now correctly based on the OS/2 typographic metrics
(
sTypoAscender/sTypoDescender/sTypoLineGap) instead of the hhea table values. - The default
lineHeightmultiplier has changed from1.2to1. Together with the switch from hhea to OS/2 typographic metrics, these changes make line spacing follow the font's own vertical metrics instead of applying a fixed CSS-style multiplier.
0.5.6 - 2025-01-19
- Support for embedded files via the
embeddedFilesproperty in the document definition.
- A bug that caused errors when reusing fonts or images across multiple documents.
0.5.5 - 2024-12-18
The minimum EcmaScript version has been raised to ES2022. Minimum build requirements have been raised to Node 20 and npm 10.
-
The functions
line(),rect(),circle(), andpath()to create graphics shapes with less code and better tool support. -
The functions
text(),image(),rows(), andcolumns()to create blocks with less code and better tool support. -
The function
span()to create text spans with less code and better tool support. -
The functions
bold()anditalic()to conveniently create text spans with bold or italic styles. -
The
PdfMakerclass to render multiple documents with the same font configuration.const pdfMaker = new PdfMaker(config); pdfMaker.registerFont(await readFile('path/to/MyFont.ttf')); pdfMaker.registerFont(await readFile('path/to/MyFont-Bold.ttf')); const pdf1 = await pdfMaker.makePdf(doc1); const pdf2 = await pdfMaker.makePdf(doc2);
-
Fonts should now be registered with the
registerFont()method on thePdfMakerclass. -
The
imageproperty of an image block now supportsdata:,file:, andhttp(s):URLs. File names are relative to a resource root that must be set by thesetResourceRoot()method on thePdfMakerclass.
TextAttrsin favor ofTextProps.BlockAttrsin favor ofBlockProps.InfoAttrsin favor ofInfoProps.CustomInfoAttrsin favor ofCustomInfoProps.Textin favor ofTextSpan.LineOptsin favor ofStrokeProps.RectOptsin favor ofRectProps.CircleOptsin favor ofCircleProps.PathOptsin favor ofPathProps.- The
fontsproperty in a document definition. - The
imagesproperty in a document definition. - The
makePdffunction in favor of themakePdfmethod on thePdfMakerclass. - Using file paths as image sources in favor of
file:URLs.
0.5.4 - 2024-02-25
- Text properties
fontStyleandfontWeight.
- The
imageproperty of an image block now supports a file name. When file names are used, the images don't need to be registered with the globalimagesproperty anymore.
- Text properties
boldanditalicin favor offontStyle: 'italic'andfontWeight: 'bold'.
- The optional
formatproperty of an image definition. The format is now auto-detected from the file content.
- Text in a text block will no longer break before the first row, which would result in an empty frame.
0.5.3 - 2023-09-28
- An edge case that could lead to a duplicated row after a page break has been fixed.
0.5.2 - 2023-07-06
- The
widthproperty of aBlocknow supports the valueautoon all block types. When set toauto, the block will shrink to the width of its contents.
0.5.1 - 2023-06-30
-
The property
marginin a document definition now supports a function that returns the margin for a given page. -
Support for PNG images. A new, optional property
formatis added to image definitions. For PNG images, it must be set topng(defaults tojpeg).
-
In the PDF metadata, the fields "Creator" and "Producer" are no longer set to default values.
-
Consecutive newlines in texts are no longer collapsed. Blank lines are now rendered as expected.
-
Images registered in the document definition are now only included in the PDF when they are used in the document.
0.5.0 - 2023-05-18
-
When a graphics element has neither
lineColornorfillColorset, it is stroked by default. If alineWidthbut nolineColoris set on an element that also has afillColor, the element is now stroked with a black line. -
Rows in a
RowsBlockwill now break and continue on the next page when they do not fit. To prevent this, setbreakInsidetoavoid. -
Lines in a
TextBlockwill now break and continue on the next page when they do not fit. To prevent this, setbreakInsidetoavoid. -
The
lineJoinproperty is no longer supported by the graphics typeCircle.
-
Property
breakInsideto control page breaks inside a block onTextBlockandRowsBlock. The default isauto. -
Property
insertAfterBreakonRowsBlockto insert an extra block after a page break. -
Properties
translate,scale,rotate,skewandmatrixon all graphics elements to apply transformations.
0.4.2 - 2023-04-29
- Text property
letterSpacing. - Support for SVG paths in
graphicsusingPathelements.
0.4.1 - 2023-04-15 (not available)
Note: This npm package pdfmkr@0.4.1 had to be unpublished because of
a build error. Do to npm's policy, the version number cannot be reused.
- Text rise is now reset properly and does not affect subsequent text elements anymore.
0.4.0 - 2023-03-27
- Page margins are now relative to the header and footer to let the contents adjust to a dynamic header and footer height.
- Text property
risefor superscripts and subscripts. - Block property
verticalAlignfor vertical alignment of columns. - Property
lineDashfor graphics shapes.
0.3.3 - 2023-03-03
- An error was thrown when rendering a document definition that includes
a
headerbut nofooter.
0.3.2 - 2022-10-12
- Property
customDatato include custom data in the PDF document catalog.
0.3.1 - 2022-08-25
- PDF now has a trailing newline
- Link annotations are now compatible with PDF/A
- The PDF trailer now has an ID (needed for PDF/A compatibility)
0.3.0 - 2022-07-28
- Renamed block types
ParagraphtoTextBlock,ImagetoImageBlock,ColumnstoColumnsBlock, andRowstoRowsBlock. AddedEmptyBlockfor blocks that don't have any content.
- Graphics shape type
circle. - Properties
lineOpacityandfillOpacityon graphics shapes. - Property
paddingon all block types. - Properties
breakBeforeandbreakAfteron top-level blocks. - Margins and paddings are highlighted when guides are enabled.
- Property
imageAlignmarked optional in type definition - Copied text from a PDF document now includes headers and footers in correct order
0.2.0 - 2022-06-08
- Properties
strokeWidth,strokeColorhave been renamed tolineWidth,lineColor. - Images are horizontally centered by default.
- Text is now vertically aligned in text rows.
- Properties
lineCapandlineJoin. - Support for functions in the
graphicsproperty. - Property
imageAlignfor horizontal alignment. - Property
pageSizeandpageOrientation.
- Position of anchors in PDF does not include the padding or paragraphs anymore.
0.1.0 - 2022-04-25
First public version.