bpampuch / pdfmake

Client/server side PDF printing in pure JavaScript
http://pdfmake.org
Other
11.61k stars 2.04k forks source link

Error if footer and height auto #2212

Open flroux opened 3 years ago

flroux commented 3 years ago

Tested in playground with pdfmake 0.1.70 on Firefox 86.0.1:

var dd = {
    content: [
        'First paragraph',
        'Another paragraph, this time a little bit longer to make sure, this line will be divided into at least two lines'
    ],
  pageSize: {
    width: 595.28,
    height: 'auto'
  },
  footer: {
    columns: [
      'Left part',
      { text: 'Right part', alignment: 'right' }
    ]
  },
}

result: no pdf generated error in browser console: Uncaught (in promise) Error: unsupported number: Infinity

nikitasharma2692 commented 3 years ago

You have to assign a specific number to footer for it to work. It wont work with height auto

Tasen-pro commented 3 years ago

You have to assign a specific number to footer for it to work. It wont work with height auto

how to do that?

fikrivoxel commented 2 years ago

any solution with this ?

shessafridi commented 1 year ago

@fikrivoxel Just put the footer code inside the content height: 'auto' doesn't work with footer