1

Ubuntu 12.04 LTS, 3.8.0-35-generic kernel, Firefox 27.0

  1. If I print a text file to pdf, I get a default filename which is always the same. (it is always "output.pdf")

    • How can I have automatic file name based on timestamp?
    • How can I use that particular printer in command line?
    • What is the name of that (virtual)printer I'm using?
  2. also from firefox, if I print to pdf

    • How can I have automatic filename based on timestamp?

following some commands and the output I received:

~$ lp "$in"
lp: Error - no default destination available.

~$ lpr "$in"
lpr: Error - no default destination available.

~$ dpkg --list | grep ' cups '
ii  cups    1.5.3-0ubuntu8    Common UNIX Printing System(tm) - server

~$ ps -ef|grep cups | grep -v grep
root   867   1  0 14:51 ?   00:00:00 /usr/sbin/cupsd -F

~$ cups --version 
cups: command not found

~$ cups-pdf
cups-pdf: command not found

I would like not to install other PDF printer, because the default one works very well.

Amanda
  • 9,723

1 Answers1

1

I'm still not 100% sure what you're trying to do (it would help to know more about what kind of file you're starting with) but you have a lot of options.

From the Ubuntu Forums, try a2ps and ps2pdf

$ a2ps file.txt -o file.ps
$ ps2pdf file.ps file.pdf

a2ps (Anything to Post Script) you'll have to install, ps2pdf(Post Script to PDF) should be installed already.

Or from How to print a regular file to pdf from command line you can try enscript.

Or if you want to write something in Python, reportlab's pdfgen is great.

And if you need to do any work after you've created a PDF, pdftk is great for manipulating finished PDFs or water marking them.

Amanda
  • 9,723