Pdfmake: Increase Header Size PDF make

Created on 26 Jan 2016  路  2Comments  路  Source: bpampuch/pdfmake

I am trying to increase the header size on a pdf using pdfmake.
Currently am able to get a header on both the left and right of the page, which is what I want, but when the height passes 26, the image disappears because there is a limited amount of space for the header.

The margin can be decreased to increase the size but i want the margin to remain.

If you need to test anything, try the code I have so far on playground

var dd = {

        pageSize: 'LEGAL',
        pageOrientation: 'landscape',

        header: {
            margin: 8,
            columns: [
                {

                    table: {
                        widths: [ '50%','50%'],

                        body: [
                            [
                                { image: 'sampleImage.jpg',

                                    width: 80, height: 26,

                                },

                                { image: 'sampleImage.jpg',

                                    width: 80, height: 26,
                                    alignment:'right'}
                            ]
                        ]
                    },
                    layout: 'noBorders'
                }



            ]
        },



    content: [
        'First paragraph',
        'Another paragraph, this time a little bit longer to make sure, this line will be divided into at least two lines'
    ]
}

Most helpful comment

You need to add a pageMargins and adjust the second parameter to your header size.

var dd = {

        pageSize: 'LEGAL',
        pageOrientation: 'landscape',

        header: {
            margin: 8,
            columns: [
                {

                    table: {
                        widths: [ '50%','50%'],

                        body: [
                            [
                                { image: 'sampleImage.jpg',

                                    width: 80, height: 60,

                                },

                                { image: 'sampleImage.jpg',

                                    width: 80, height: 60,
                                    alignment:'right'}
                            ]
                        ]
                    },
                    layout: 'noBorders'
                }

            ]
        },

    content: [
        'First paragraph',
        'Another paragraph, this time a little bit longer to make sure, this line will be divided into at least two lines'
    ],
    pageMargins: [40, 80, 40, 60]
}

All 2 comments

You need to add a pageMargins and adjust the second parameter to your header size.

var dd = {

        pageSize: 'LEGAL',
        pageOrientation: 'landscape',

        header: {
            margin: 8,
            columns: [
                {

                    table: {
                        widths: [ '50%','50%'],

                        body: [
                            [
                                { image: 'sampleImage.jpg',

                                    width: 80, height: 60,

                                },

                                { image: 'sampleImage.jpg',

                                    width: 80, height: 60,
                                    alignment:'right'}
                            ]
                        ]
                    },
                    layout: 'noBorders'
                }

            ]
        },

    content: [
        'First paragraph',
        'Another paragraph, this time a little bit longer to make sure, this line will be divided into at least two lines'
    ],
    pageMargins: [40, 80, 40, 60]
}

Answered.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

einfallstoll picture einfallstoll  路  3Comments

michaelqiji picture michaelqiji  路  3Comments

ValeSauer picture ValeSauer  路  3Comments

kamilkp picture kamilkp  路  3Comments

kumarandena picture kumarandena  路  3Comments