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?
Asked
Active
Viewed 28 times
2 Answers
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.
harrymc
- 480,290
-
hi, thanks to both of you. for the starboard It works! – claud Sep 13 '21 at 18:06
-
For the answer that was most helpful among the two, consider marking it as accepted (click the ✔ sign). – harrymc Sep 13 '21 at 18:37