1

I have a long HTML document and I would like to convert it to PDF. After converting it to PDF the document has some inconvenient divisions (e.g. graphics, tables split in half by page break). Is there any command to add to the HTML code for the virtual PDF printer to end the page at the desired point?

Mureinik
  • 4,024
claud
  • 13

2 Answers2

0

Open a copy of the document in a text editor. Find the exact place where you want to stop the print. Add tag on its own line. Delete everything below that till the end of the page, save the page with a new name and open it in browser. Does it now look like what you want to print?

Peregrino69
  • 4,664
0

You will need to modify the HTML, requiring some understanding of the syntax:

  • Save the complete HTML page

  • Edit the page using a text editor

  • Add the following CSS class:

      @media print {
          .pagebreak {
              clear: both;
              page-break-after: always;
          }
      }
    
  • Locate the place to insert the page-break and add this text:

      <div class="pagebreak"> </div>
    
  • You can now print the HTML file with the page-breaks.

They won't show up on the page, but will break up the page when printing.

source

harrymc
  • 480,290