1

I am using abcpdf converter to convert text to PDF.

My Html document has multiple rows:-

<tr><td>somecontent1</td></tr>
<tr><td>somecontent2</td></tr>
<tr><td>somecontent3</td></tr>
<DIV style="PAGE-BREAK-BEFORE: always"></DIV>
<tr><td>somecontent4</td></tr>
<tr><td>somecontent5</td></tr>
<tr><td>somecontent6</td></tr>

Now what I am expecting is first 3 rows should come on Page1 and the rest 3 on page 2.

Because content in one of the rows of first page is large, half of the content from 3rd row of first page is coming on second page.

What I am looking for is a way to shift the content to next page if not fitting in the current page

Please let me know if I am not clear enough.

Pranali Desai
  • 974
  • 1
  • 7
  • 22

1 Answers1

0

It depends on which page size you are printing on,yo need to calculate the height allowed per page and if your contents of 3rd row exceeds that then insert<DIV style="PAGE-BREAK-BEFORE: always"></DIV> before that.

similar here

Community
  • 1
  • 1
Cris
  • 12,799
  • 5
  • 35
  • 50
  • Cris,content coming is dynamic from the database, so not possible to get the height or may be I am not aware of an easier way of doing it. – Pranali Desai Jan 24 '13 at 04:48
  • Also the link you have mentioned is for fitting content to the page which basically is zoomout and store kind – Pranali Desai Jan 24 '13 at 04:50
  • it is a string,right?you need to manipulate it and manually insert page breaks,no other option available to you – Cris Jan 24 '13 at 04:51
  • but out of text how do you define what should be height, and since incoming is html that can vary if it has different font size and image. what I am looking for is a way to shift the content to next page if not fitting in the current page. – Pranali Desai Jan 24 '13 at 05:00
  • parse your string using any HTML parser and add html elements per page according to your need – Cris Jan 24 '13 at 05:08