javascript - Splitting data into pages depending on height (creating a printable song book) -
im trying make song book eg. birthdays, weddings etc. choose couple of songs , songs shown on website in size of a5 paper, , users can edit text there, before converting pdf. create new page each song, fill out space possible. having more 1 song per page, or atleast have verses of song on same page, , show rest on next page.
a5 size height: 793.7px width: 559.3px
<div class="songpage currentpage"> <h4>song #1</h4> <div class="verse"> <table> <tr> <td> <p>1 - lipsum lipsum</p> <p>2 - lipsum lipsum</p> <p>3 - lipsum lipsum</p> <p>4 - lipsum lipsum</p> <p>5 - lipsum lipsum</p> </td> <td> <p>6 - lipsum lipsum</p> <p>7 - lipsum lipsum</p> <p>8 - lipsum lipsum</p> <p>9 - lipsum lipsum</p> </td> </tr> </table> </div> <h4>song #2</h4> <div class="verse"> <table> <tr> <td> <p>1 - lipsum lipsum</p> <p>2 - lipsum lipsum</p> <p>3 - lipsum lipsum</p> <p>4 - lipsum lipsum</p> <p>5 - lipsum lipsum</p> </td> <td> <p>6 - lipsum lipsum</p> <p>7 - lipsum lipsum</p> <p>8 - lipsum lipsum</p> <p>9 - lipsum lipsum</p> </td> </tr> </table> </div> </div>
the green line indicates song should split , continue on next page. lets <h4> = 60px height <p> = 90px height
how can check elements height , split them new pages (closing tags , creating new div.songpage) when max height reached. max height 793.7px.
if can come example of sort or guide me in right direction - i'll appreciate it!
Comments
Post a Comment