Pdfmake: Wrap Text support?

Created on 6 Feb 2016  路  7Comments  路  Source: bpampuch/pdfmake

Most helpful comment

makepdf support noWrap: true for text.

Example noWrap in table (column 2):

var dd = {
    content: [
        {

            table: {
                widths: ['*', 'auto'],
                body: [
                    [
                    'This is a star-sized column. The next column over, an auto-sized column, will not wrap to accomodate all the text in this cell, because it has been given the noWrap style.',
                    { text: 'I am auto sized and noWrap.', noWrap: true }
                    ]
                ]
            }

        }
    ]
};

This is what you want?

All 7 comments

Yes, text wrap is supported. Examples here: http://pdfmake.org/playground.html

Thanks for the information, let me clarify my question: What I want to ask is something like white-space:nowrap supported?

makepdf support noWrap: true for text.

Example noWrap in table (column 2):

var dd = {
    content: [
        {

            table: {
                widths: ['*', 'auto'],
                body: [
                    [
                    'This is a star-sized column. The next column over, an auto-sized column, will not wrap to accomodate all the text in this cell, because it has been given the noWrap style.',
                    { text: 'I am auto sized and noWrap.', noWrap: true }
                    ]
                ]
            }

        }
    ]
};

This is what you want?

Not exactly what I mean, see following:
var dd = {
content: [
{

        table: {
            widths: [100,100],
            body: [
                [
                'This is a star-sized column. The next column over, an auto-sized column, will not wrap to accomodate all the text in this cell, because it has been given the noWrap style.',
                { text: 'I am auto sized and noWrap.', noWrap: true }
                ]
            ]
        }

    }
]

};

As you can see, in fixed width column, noWrap doesn't work, I'm trying to do something like nowrap in excel.

Hmm, if table have fixed-width column size pdfmake always wraps... I try use in text 'NO-BREAK SPACE' (Alt 0160), but causes problem from issue #204.
Probably not supported what you need.

Was this page helpful?
0 / 5 - 0 ratings