How to use the pdfmake/build/pdfmake.tableLayouts function in pdfmake

To help you get started, we’ve selected a few pdfmake examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github code-for-nashville / power-of-attorney / src / components / async-download-pdf / DownloadPDF.js View on Github external
import {Box, Button, Header} from 'grommet'

import pdfFonts from 'pdfmake/build/vfs_fonts'
import pdfMake from 'pdfmake/build/pdfmake'
import type {FormInputs} from '../../types'
import createDocDefinition from '../../pdf/pdf-document'

import './style.css'

type DownloadPDFProps = {
  data: FormInputs
}

pdfMake.vfs = pdfFonts.pdfMake.vfs

pdfMake.tableLayouts = {
  underlineLayout: {
    hLineWidth: function(i, node) {
      if (i === 0) {
        return 0
      }
      return 1
    },
    vLineWidth: function(i) {
      return 0
    },
    hLineColor: function(i) {
      return 'black'
    },
    paddingLeft: function(i) {
      return 0
    },