javascript - Add border arround a paragraph with pdfmake -
i'm generating pdf via pdfmake.
let's have content of pdf this
var docdefinition = { content: [ 'lorem ipsum dolor sit amet, consectetur adipiscing elit. nullam pharetra odio.', 'vestibulum erat mauris, sodales et consequat sit amet, ultricies vitae erat. etiam feugiat orci justo, ultrices malesuada dui ornare ac.', ] };
is possible add border arround 1 of paragraphs or have use tables this?
i have not gotten apply borders paragraph. think option have use tables.
below lines have attached simple code can paste directly @ pdfmake playground in order try it.
var dd = { content: [ { style: 'tableexample', color: '#555', table: { body: [ [ { text : 'lorem ipsum dolor sit amet, consectetur adipiscing elit. nullam pharetra odio.\n\nvestibulum erat mauris, sodales et consequat sit amet, ultricies vitae erat. etiam feugiat orci justo, ultrices malesuada dui ornare ac.' } ], [ { text : 'lorem ipsum dolor sit amet, consectetur adipiscing elit. nullam pharetra odio.\n\nvestibulum erat mauris, sodales et consequat sit amet, ultricies vitae erat. etiam feugiat orci justo, ultrices malesuada dui ornare ac.' } ], [ { text : 'lorem ipsum dolor sit amet, consectetur adipiscing elit. nullam pharetra odio.\n\nvestibulum erat mauris, sodales et consequat sit amet, ultricies vitae erat. etiam feugiat orci justo, ultrices malesuada dui ornare ac.' } ], ] }, layout: { //hlinewidth: function(i, node) { // return (i === 0 || === node.table.body.length) ? 2 : 1; //}, //vlinewidth: function(i, node) { // return (i === 0 || === node.table.widths.length) ? 2 : 1; //}, hlinecolor: function(i, node) { return (i === 0 || === node.table.body.length) ? 'red' : 'blue'; }, vlinecolor: function(i, node) { return (i === 0 || === node.table.widths.length) ? 'red' : 'blue'; }, paddingleft: function(i, node) { return 40; }, paddingright: function(i, node) { return 40; }, paddingtop: function(i, node) { return 20; }, paddingbottom: function(i, node) { return 20; } } } ], defaultstyle: { alignment: 'justify' } }
Comments
Post a Comment