Converting Blusfish syntax-highlighted PHP code in to a PDF
Gabriel Dragffy
dragffy at yandex.ru
Sat Apr 14 10:17:39 UTC 2007
Nicolas Kaiser wrote:
> 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.
>
Thanks so much - you're a king!! I don't have syntax enabled by default,
so I added "+syntax enable" to your line and it was perfect. I think
that just about wraps the topic up, at least as far as I'm concerned.
The only thing that could possible be better is doing it directly from
bluefish. I'm going to find out how to make the highlight colours darker
from VIM as they're a bit light when printed.
Cheers.
Gabe
More information about the ubuntu-users
mailing list