Converting Blusfish syntax-highlighted PHP code in to a PDF

Richard Mancusi vrman49 at gmail.com
Wed Apr 11 23:18:04 UTC 2007


On 4/11/07, Nicolas Kaiser <halforc at gmail.com> wrote:
> On 4/10/07, Gabriel Dragffy <dragffy at yandex.ru> wrote:
> > Is there any way to save the lovely syntax-highlighted code of Bluefish
> > in to a PDF? I ask only because I need to have code samples, and it
> > would be fantastic if they could be highlighted. Also PDF is nice and
> > compatible :)
>
> I haven't found an option to print from Bluefish itself yet, however
> if you just need syntax-highlighting, you can do so with vim, like
> this:
>
> vim "+ha >test.ps" +q test.php
>
> should print syntax-highlighted to a postscript file. ("+q" is for
> quitting vim immediately after printing.)
> If this is useful enough for you, it might be possible to elaborate on
> it (like printing to pdf straight away) and add it to "external
> commands" in Bluefish, for convenience.
>
> Cheers,
> n.

You can print from Bluefish - it just needs to be setup.  Following is
my strange setup - I suspect there is a better way.

1. Edit/Preferences/External programs
   Utilities and filters section
   Add
   (I added 3 "printers" - this is where YOU can get inventive)
   Label = Print    Command = lpr '%s'
   Label = enscript   Command = enscript -B --font=Courier8 -M letter '%s'
   Label = enscript-hdr   Command = enscript --font=Courier8 -M letter '%s'

2. Then anytime you wish to print go into External/Commands
    Your "printers" will be there for selection.

Again, I need to stress that this is what I need.  You can put nearly
any command syntax in there.  Look at man lpr and man enscript for
starters.  In a rush - hope there aren't any typo's.

hth
-rich




More information about the ubuntu-users mailing list