If you want to export pdf with many pages from html code, I recommend you to use html2pdf.js library, this library will solve the problem of page cutting as well as the content of the pages will not be lost above and below.