Skip to content

0.1.22

Compare
Choose a tag to compare
@liborm85 liborm85 released this 23 Dec 06:42
· 932 commits to master since this release

Features:

  • update to PDFKit v0.8.0 with fontkit (support otf and woff font formats)
  • update all dependencies and uplift code to work with latest package versions
  • added yarn support
  • allow to specify CreationDate property
  • compression is enabled by default. Can be disabled by compress: false
  • watermark formatting/styling
  • border for table cells
  • gulp: added the ability to create virtual file system for fonts. Command: gulp buildFonts
  • added parameter pageSize to header function

Bugfixes:

  • fixed print and open for large files
  • fixed links support
  • fixed building on Windows
  • don't add up the images horizontal offset
  • catch malformed table row error
  • validate text before replacing
  • fixed tables bug with header border lines on new pages being repeated several times
  • fixed check of browser support, no more being annoyed while building too
  • update FileSaver.js submodule to latest master, this should fix problems with using pdfmake on iOS devices
  • fixed a problem with the performance for large documents
  • and other fixes...

Watermark formatting

example with own format:

var docDefinition = {

...
    watermark: {text: 'test watermark', color: 'blue', opacity: 0.3, font: 'Courier', bold: true, italics: true},
...

};

example without formatting:

watermark: 'test watermark'

Border for table cells

example of table cell:

{
    //      (left border, top border, right border, bottom border)
    border: [false, true, false, false],
    text: 'text in table cell'
}

New parameter pageSize in header function

var docDefinition = {
  footer: function(currentPage, pageCount) { return currentPage.toString() + ' of ' + pageCount; },
  header: function(currentPage, pageCount, pageSize) {
    // you can apply any logic and return any valid pdfmake element

    return [
      { text: 'simple text', alignment: (currentPage % 2) ? 'left' : 'right' },
      { canvas: [ { type: 'rect', x: 170, y: 32, w: pageSize.width - 170, h: 40 } ] }
    ]
  },
  (...)
};