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 <p>
tags, this would help fit more. Is this possible? Thanks.
views:
207answers:
4Thanks y_nk, I use firebug when I can but it isn't much help when working with PDF!!
DaveDev
2010-05-07 09:09:31
But Dave, if you pass it a URL to your page you can use the URL to check how the page renders. :)
ANeves
2010-05-07 09:14:43
True sr pt, but the PDF doesn't get rendered the exact same as what we see in the browser. I do use the IE Developer Toolbar sometimes to get an insight into the structure of the HTML but this PDF generator we use is a very untame beast.
DaveDev
2010-05-07 09:29:12
+1
A:
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.
Mauro
2010-05-07 09:02:12
It's `margin` only. `p` tags don't use `padding` for their default spacing, and `line-height` is spacing between lines (which if decreased will cause lines to overlap.
Delan Azabani
2010-05-07 09:03:13
Without having access to the actual source I cannot assure that line-height wouldn't help, even if, as stated, it's not recommended.Padding would not change space between two paragraphs but nonetheless, if setted to a value greater than 0 it will VISUALLY ends in a greater space between the twos.Thanks for the note! :)
Mauro
2010-05-07 11:21:16
A:
The CSS margin
property can be used to affect all paragraphs:
p {
margin: XXXem;
}
Replace XXX
with your desired value; for no space at all use:
p {
margin: 0em;
}
Delan Azabani
2010-05-07 09:02:40