tags:

views:

207

answers:

4

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.

+2  A: 

use css :

p { margin:0 }

Try this wonderful plugin http://www.getfirebug.com :)

y_nk
Thanks y_nk, I use firebug when I can but it isn't much help when working with PDF!!
DaveDev
But Dave, if you pass it a URL to your page you can use the URL to check how the page renders. :)
ANeves
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
A: 

Look Here

drorhan
+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
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
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
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