Closed imiegab closed 7 years ago
Hi,
For some reason, spaces seams to be trimed after a new line. I'm trying to write code samples in pdf. I can't find a way to show a correct indentaton :
var dd = { content: [ { text: 'if(foo){\n console.log(foo);\n console.log(bar);\n}' } ] }
Result :
if(foo){ console.log(foo); console.log(bar); }
I tried to replace it with \t characters, got a weird behavior :
var dd = { content: [ { text: 'if(foo){\n\t\tconsole.log(foo);\n\t\tconsole.log(bar);\n}' } ] }
When the line starts with another character, there is no problem :
var dd = { content: [ { text: 'if(foo){\n. console.log(foo);\n. console.log(bar);\n}' } ] }
if(foo){ . console.log(foo); . console.log(bar); }
Is that a normal behavior? Am I doing something wrong? How can I get it right?
duplicate: https://github.com/bpampuch/pdfmake/issues/558
Hi,
For some reason, spaces seams to be trimed after a new line. I'm trying to write code samples in pdf. I can't find a way to show a correct indentaton :
Result :
if(foo){ console.log(foo); console.log(bar); }
I tried to replace it with \t characters, got a weird behavior :
Result :
if(foo){ console.log(foo); console.log(bar); }
When the line starts with another character, there is no problem :
Result :
if(foo){ . console.log(foo); . console.log(bar); }
Is that a normal behavior? Am I doing something wrong? How can I get it right?