bpampuch / pdfmake

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

Error: unsupported number: NaN #2491

Open joshgc19 opened 2 years ago

joshgc19 commented 2 years ago

I get the unsupported number when I try to create doc and download, this is my document:


        header: {
            table: {
                widths: ['30%', 'auto'],
                heights: [40, 40],
                body: [
                    [
                        {
                            fillColor: 'black',
                            image: 'logo',
                            width: '30%',

                        },
                        {
                            text: 'REPORTE DE ÁREAS Y ELEMENTOS',
                            style: 'header',

                        }]
                ],
            },

        },
        pageMargins:[30,60,30,30],
        styles: {
            header: {
                fontSize: 18,
                bold: true,
                alignment: 'center',
                margin: [0, 10, 0, 0],
                color: 'white',
                fillColor: 'black',
            },
        },
        images: {
            logo: "https://foyer-administration.s3.amazonaws.com/static/white_main_logo.png"
        }
    }```
maxpropp commented 2 years ago

it could be your "width: '30%'". I remember having issues with this.

oleteacher commented 2 years ago

I also had issues with % on widths. Honestly do think PDF even respects % in sizes.