Try these links for ideas:
Print to PDF in Ubuntu
Print to PDF Using cups-pdf
Create PDF documents in Ubuntu
If you print to a file from Firefox in Ubuntu it makes a PostScript document (.ps). You can convert that to a PDF with ps2pdf. If it isn't installed by default, you can install it with apt-get or Synaptic. Type man ps2pdf in the terminal for instructions on how to use it.
More information about formatting options