How to specify PDF page size using pdfkit in python

7.5k views Asked by At

I know in node we can do something set size: [width,height] like this. But while I replace this in python options = {'page-size':'A4'} with options = {'page-size':[width,height]} I get an error.

I want to set a width of 60mm for POS

1

There are 1 answers

0
delouisiano On

as said here and here, the correct syntax is:

options = {
    'page-height': 'yourHeight',
    'page-width': 'yourWidth',
}