pdfmake API? Is there a list of styles, fonts, capabilities?

14,072

Here you go.. At least, uncommented below styles are supported. I tried it myself.

['font',
'fontSize',
'bold',
'italics',
'alignment',
'color',
'columnGap',
'fillColor',
'decoration',
'decorationStyle',
'decorationColor',
'background',
'lineHeight'
//'tableCellPadding'
// 'cellBorder',
// 'headerCellBorder',
// 'oddRowCellBorder',
// 'evenRowCellBorder',
// 'tableBorder'
]

You could use the above styles, as below.

var dd = {
    content: [
        { 
            text: 'This is a header, using header style', 
            style: 'header' 
        }
    ],
    styles: {
        header: {
            fontSize: 18,
            bold: true,
            background: '#ff1'
        }
    }
}
Share:
14,072

Related videos on Youtube

rashadb
Author by

rashadb

I'm the Founder and CEO of CashPass, a Fintech/AdTech start-up currently in the fashion/clothing niche. My focus is the MEAN stack and am skilled with the Stripe, Dwolla, Plaid, Mailgun and SendGrid APIs. The geolib, underscore, lodash and moment libraries are awesome. I use Heroku with mLab for deployment. I also know Parse and have dabbled with Meteor. I'm in the midst of applying Javascript for mobile. More on that soon.

Updated on June 04, 2022

Comments

  • rashadb
    rashadb almost 2 years

    I'm using pdfmake. I want to format a document and they have good examples on github and in their playground but I was wondering if they featured all capabilities therein. I get the feeling that their may be additional properties like switching fonts, adding different style elements or underlining - things not expressly shared in the examples. Maybe what you see is what you get and that is all but I went over the github page pretty throughly and did not find a more detailed list of capabilities. It seems hella similar to html but it doesn't seem to have the same styling capabilities of html/css, if there is something more could someone please point it out.

  • Anoop P S
    Anoop P S over 4 years
    is ther a way to chage the case of text