bpampuch / pdfmake

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

Styles not being applied to nested text array #1174

Open helenev opened 6 years ago

helenev commented 6 years ago

I am having a problem applying a style to a text array when it's been nested.

For example, if I want to apply a style to a whole text array then I can do this as follows:

    { 
            bold : true, 
            text: [  
                'Some bold text ', 
                { text: 'Some bold underlined text ', decoration: 'underline' }, 
                'Some more bold text' 
            ], 
    },

However, if that array is nested it doesn't seem to apply the bold style:

       {   
            text : [
                {text: 'Some normal text '},
                {
                            bold : true, 
                    text: [  
                        'Some bold text ', 
                        { text: 'Some bold underlined text ', decoration: 'underline' }, 
                        'Some more bold text ' 
                    ],
                }
            ],
    }
luizhenriquerdias commented 5 years ago

Any update? My example: content: [ { alignment: 'center', text: [ 'normal ', { bold: true, text: [ { text: 'bold ' }, { italics: true, text: ['bold and italics '] }, { text: 'bold ' } ] }, 'normal' ] } ]