How to create PDF using pdfMake in react having pages in landscape orientation and split in two like book pages

  Kiến thức lập trình

I am creating a PDF file form my react app inserting some images, tables and text and its working perfectly fine in potrait mode. But now i need a change in design of that exported pdf so that i can show page in landscape orientation where each page is split in half to show different data on each side of the page. I could not find any specific details in documentation. How can i achieve this functionality?

tried using this from the documentation but it only changes the orientation and there no options to split the page.

var docDefinition = {
  // a string or { width: number, height: number }
  pageSize: 'A5',

  // by default we use portrait, you can change it to landscape if you wish
  pageOrientation: 'landscape',

  // [left, top, right, bottom] or [horizontal, vertical] or just a number for equal margins
  pageMargins: [ 40, 60, 40, 60 ],
};

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT