Converting Blusfish syntax-highlighted PHP code in to a PDF
Nicolas Kaiser
halforc at gmail.com
Sat Apr 14 09:55:15 UTC 2007
On 4/13/07, Gabriel Dragffy <dragffy at yandex.ru> wrote:
> Your command works flawlessly, once I have done "syntax enable" and I
> get a great .ps file.
Sorry I forgot to mention syntax enable. Must be buried in a
configuration file at my place.
> My final question is "what about PDF?". I have
> found that I can 'cat' the .ps file and pipe that in to lp, but all my
> attempts to integrate this operation in VIM's command line have failed -
> can you suggest something?
Using cups-pdf, you can specify the printer that vim uses like
:set printdevice=Virtual_Printer
(or however the pdf-printer may be named in cups,) as a single command like
vim "+set printdevice=Virtual_Printer" +ha +q test.php
and the pdf output (here named: test.pdf) will go to the directory
specified in cups-pdf configuration.
There are also lots of print options that can be set like eg.
:set printoptions=header:0
for suppressing the header.
Another way would be using ghostscript's "ps2pdf" for converting .ps to .pdf.
Cheers,
n.
More information about the ubuntu-users
mailing list