is there a way to create multiple page pdf with different page orientation using pdfmake?
to make it simple, I want something like this :
I've tried it so many times with different method but it always effect to all page.
This is and old question, but answering may help others.
If you want to change page orientation you only need specify the new value at the first node of the page.
Below this lines I have attached a simple code that you can paste directly at pdfmake playground in order to try it.
Good luck!
var dd = {
content: [
{
text: 'Unordered list',
style: 'header'
},
{
ol: [
'item 1',
'item 2',
'item 3',
]
},
{
text: '\n\nUnordered list with longer lines',
style: 'header',
pageBreak: 'before',
pageOrientation: 'landscape'
},
{
ol: [
'item 1',
'Lorem ipsum dolor sit amet, consectetur ..',
'item 3',
]
},
{
text: '\n\nNested lists',
style: 'header',
pageBreak: 'before',
pageOrientation: 'portrait'
},
{
ol: [
'item 1',
'Lorem ipsum dolor sit amet, consectetur ..',
{
ol: [
'subitem 1',
'subitem 2',
'subitem 3 - Lorem ipsum dolor sit ame...',
'subitem 4',
'subitem 5',
]
},
'item 3\nsecond line of item3',
]
},
],
styles: {
header: {
bold: true,
fontSize: 15
}
},
defaultStyle: {
fontSize: 12,
}
}