Printing from Bluefish

A frequently commented upon weakness of the otherwise excellent Bluefish editor is that there is no print command. That is easily remedied, however.

Update: Printing has been added to Bluefish 2.2.3, hooray! The following is retained for reference.

In Edit – Preferences – External filters, press “Add”. A new entry labeled “Untitled” will appear. Select and then click it to edit its name. Rename it to something like “Print Current File” and press enter to apply it. Now click to the right of the new name, in the “Command” column, to enter a command. Enter an appropriate printing command such as:

lp -o media=letter -o prettyprint -o page-top=72 -o page-left=54 -o cpi=12 -o lpi=8 %f

Press enter to apply it. Now close the Preferences window by pressing “OK”.

To use, simply go to Tools – Filters – Print Current File, and your file will print.

In the above example, -o name=value are options of lp; see the lp manpage. The %f variable tells Bluefish to pass the filename to a command (here, to lp).

TODO: Find a better solution. This prints the last saved version of a file. If your file has unsaved changes, those changes will not be printed. Likewise, if you have not yet saved your work, nothing will print. One solution is to use the command above but without -o prettyprint and without %f; this will print the current contents of the editing window but without an identifying header (no file name, no date). A better solution would be a way to print the current contents of the editing window and with a header, identifying it as “Untitled” if you have not yet saved your work — but I don’t know how to do that.

Advertisements

About Warren Post

So far: Customer support guy, jungle guide, IT consultant, beach bum, entrepreneur, teacher, diplomat, over-enthusiastic cyclist. Tomorrow: who knows?
This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

14 Responses to Printing from Bluefish

  1. anonymous says:

    jbdough writes:hmm, the command works from the command line, substituting filename for %sI tried '%s' as instructed athttp://bluefish.openoffice.nl/manual/ch07s08.html#external-commandseven though their pre-installed chmod command does not use the single quotes.It might be a cups thing – thank you anyway!It amazes me how few relevant hits I get searching this issue.It reminds me of actually fishing, trying to get the bait past the bluefish to the fish I want to catch!

  2. wpost says:

    Bluefish 2.x changed the external filters syntax, so my instructions — which I wrote for v.1.0.7 — silently fail on version 2. I've updated the instructions above, which I have tested on v.2.0.2. Hope this works for you.The online manual you were looking at was written for v.1. I don't think there's a v.2 manual yet, but Edit – Preferences – External Filters does display a condensed guide to the new syntax.And I have the same frustration you do every time I try to search the web for "bluefish". No matter how I phrase my search terms, I get more fish-related hits than relevant links.

  3. anonymous says:

    jbdough writes:thank you Warren. Now I'll try it with enscript too.

  4. wpost says:

    Enscript sounds like a good idea. If you get it working, let me know how you did it.

  5. wpost says:

    I agree, it's an odd omission from its feature set. If it were Linux only, and it were to ship with a built in print filter, I'd understand. But it's not and it doesn't. (shrugs)

  6. anonymous says:

    ijf8090 writes:Thanks – this is a workable solution. Still baffled as to why this extremely basic functionality is unavilable in an otherwise very power editor.

  7. anonymous says:

    sakol writes:I have found that print it out by gedit is very best. Just use gedit open it and print. You will get colors too. I like bluefish and use it. But like gedit to print.

  8. anonymous says:

    Anonymous writes:I couldn't figure it out. That command was not there on version 2.0.-0-1. I just uninstalled it. What kind of program that deals with css / html or even just text files does not have a simple print command? There are plenty of other editors out there that can do this without wasting my time.

  9. canjayar says:

    My solution is to print from gedit, which prints in colour.First you need to install gedit, e.g. for Ubuntu type:sudo apt-get install geditThen open Bluefish and from Edit – Preferences – External Programs – Utilities and filters – Add:Under Label type:geditUnder Command type:/usr/bin/gedit '%s'&This opens your saved file (note it MUST be saved) in gedit in the background. So to print a file from Bluefish you just go to External – Commands – gedit and this will open your file in gedit, which has the option to print. Even if you forget to close gedit after printing and accidentally edit it from there – save your file and close gedit. Back in Bluefish you should be presented with a dialogue which says that the current file has been altered by another process and do you wish to reload it. Answer "Yes."Works fine in BlueFish 1.0.7. :)

  10. sidimike says:

    Hello Kevin, where is ''External Programs''?With Edit – Preferences there is no '''External Programs''', only Externe Befehle (external commands) and Externe Filter (external filters),or I am blind,lg aliI use german version.

  11. wpost says:

    Sidi Mike, on my English localization of Bluefish 2.2.2, what you want is "External filters".

  12. sidimike says:

    Bluefish 2.2.3Thanks, I found and got 'gedit' on it.

  13. sidimike says:

    Hi Warren, did print function came with 2.2.3, or already before with an older version?

  14. wpost says:

    I'm using 2.2.2, and there's no built in print function. To be sure, you can check Bluefish's changelog, which ought to be on the project website.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s