tags?
I have a page that I\'m converting to PDF. This page contains a number of paragraphs and they don\'t all fit onto a single page. If I could reduce the spacing between the
Setting both margin-bottom and margin-top to 0em will remove a space between paragraphs:
<style type="text/css">
p {margin-bottom: 0em; margin-top: 0em;}
</style>
I'll suggest to set padding and margin to 0.
If this does not solve your problem you can try playing with line-height even if not reccomended.
Try
margin: 0;
padding: 0;
If this doesn't work, try
line-height: normal;
A more real-world example:
p { margin: 10px 0;}
If you're converting an HTML doc into a PDF page, but the page spills onto two pages, try reducing the font size. Of course you can also decrease the spacing between paragraphs (with the CSS margin-top/margin-bottom styles), or even the left and right gutters with margins. But to my eye, keep things in proportion and just make the text a little smaller:
p { font-size: 90%; }
or
body { font-size: 9.5pt }
<style type="text/css">
p {margin-bottom: -1em; margin-top: 0em;}
</style>
This completely worked for me. Paragraphs were right below each other. When I used 0em for both the margins, there was still some space left in between the lines. I went for Developer tools in my browser, tried with -1em and it worked.