Sublime Forum

Printing from sublime

#45

+1 for printing…

0 Likes

#46

As I’m using SublimeText as an all-purpose text editor and I just pasted some text from SG Project into it so I could print the text, I was :open_mouth: flabbergasted :open_mouth: the print option was not available.

I had to go back :unamused: to TextMate to be able to print it. Of course I could have used TextEdit as well but that program is even more dormant than TextMate lately.

So: +1 for printing.

Now I’m considering this: would I have bought SublimeText if I’d knew printing wasn’t available? I think I would have stayed with TextMate. I’m now wondering what other surprises I might encounter: basic functionality I’d expect to exist with every text editor but for some reason missing from SublimeText. I think the SublimeText people should be honest and say “we don’t support printing your documents” on the home page. I’ve mentioned this on the wikipedia page regarding SublimeText just seconds ago.

0 Likes

#47

it’s kindof a workaround but you can try installing the ExportHTML package - https://github.com/facelessuser/ExportHtml
then you can view your document/selection in the browser or print it thourgh the browser.

0 Likes

#48

Add my vote to the Add Print campaign

0 Likes

#49

printing +1

0 Likes

#50

+1 Printing.

Thanks for the great editor.

0 Likes

#51

I would love a print option!

Having to cut and paste into another editor kinda makes me grumpy O,;,O

0 Likes

#52

Please, add ‘print’ feature

0 Likes

#53

+1 for printing.

Trying really hard to like this editor, but darn you are making it difficult…please

0 Likes

#54

I would also love this functionality. I use Sublime Text at work for taking notes and recording corrections for clients, and then have to use a different editor just to print the documents. This seems incredibly basic functionality to be missing. This is honestly one of the first ‘programs’ that I have used that did not any print command! Don’t get me wrong I love it, but this inability to print is driving me bananas.

0 Likes

#55

Quick printing - currently for Windows ONLY unless someone can advise me of the equivalent (dos) commands to the following:

os.system('net use lpt1 \\\\ANDYCOMPAQ\\PrimoPDF /persistent:yes') os.system('type system_ex.txt > LPT1')

Note: This is an early draft; it works for me but please report any issues. Andy.

0 Likes

#56

I’ve updated so that it will print the current selection (if any) and optionally add a page number at the bottom of the page.

The package setting for the printer is now called “printer_name” - which makes more sense :wink:

It would be nice if someone (on Windows) tried this out :smile:

Added: It may not accept a printer-name containing spaces currently. You could rename the printer temporarily without spaces.

0 Likes

#57

My feature may now handle spaces in the printer name, and it *may *work with linux and/or osx - have no idea unless someone checks for me.

For linux and osx it should print to the default printer, or you can supply a “queue” setting to send output to a named-printer. (Again, spaces in the queue-name may not work… yet.)

0 Likes

#58

I’ve added some conditionals to make it work with non-Windows OSes, but I have no idea if these work unless someone advises me :wink:

There is also a “quick_print_reset” command for Windows (only) which reassigns LPT1 to the printer named in the package settings.

There is also a setting to use the full filename as a title at the top of the first page. Added: … and to print line numbers.

0 Likes

#59

This is cool :sunglasses: On Windows you can add the setting “use_notepad”: true. In which case it will not be necessary to configure your printer as it will use your default printer. (Notepad will flash-open and close.)

You will need to tweak Notepad’s font-size, margins, etc., and this packages’ settings for blank lines and page numbers, etc., will no longer be relevant. Unfortunately, we cannot control the number of lines to print per page as the formfeed character \f doesn’t work with notepad. Added: Wordpad might be preferable as it probably understands the formfeed character and we can designate a printer.

0 Likes

#60

[quote] // You can create your own command-line using ‘my_cmd’ and ‘my_cmd_end’.
// “my_cmd”: "WORDPAD /PT “,
// “my_cmd_end”: " YourPrinterName”
// will open the file in Wordpad and print it to your named printer.
// (Wordpad needs to be on your environment paths.)
// IMPORTANT: There needs to be spaces at the end of my_cmd and
// the beginning of my_cmd_end, as the filename will be inserted
// between these two expressions.
// Also escape back-slashes \ to \.
// Quotes will be problematic. If possible, set an environment path,
// and change your printer name, to avoid the need for quotes
// around spaces.
// Omit my_cmd_end, or set it to false, if not required.[/quote]

0 Likes

#61

If someone could spend a few minutes to confirm that my feature works (or doesn’t…) for osx or linux, that would be nice :smile:

First,** ensure your printer is shared**;
Clone, or download and copy, the files to a folder named QuickPrint in your Packages area; re-start ST, then right-click an open view and choose QuickPrint. If it doesn’t print can you look in the Console (Ctrl ’ (apostrophe, or possibly back-tick)) and note any error message(s) that appears there.

Thanks in anticipation. Andy.

0 Likes

#62

I just tried out the QuickPrint feature in OSX 10.7.5 with Sublime Text 2.0.1, Build 2217, and it doesn’t work for me.

I downloaded the zip of QuickPrint from Github, unzipped it and copied the 6 files into a folder called QuickPrint in my Sublime Text 2 packages folder. I restarted ST, and now I see a “QuickPrint” option when I right-click, but it’s greyed out. No error message shows up in the console (because I can’t click the greyed-out QuickPrint option). Is there anything further I can try to make it work?

Also, the command to pull up the console is ctrl+backtick `, not ctrl+apostrophe ', correct? Nothing happens when I type ctrl+apostrophe in ST.

0 Likes

#63

@bbarrill Thank you very much for taking a look at this.

You can view the console from the **View **menu, Show Console. (Control apostrophe works for me on Windows, but I notice the menu command suggests Ctrl back-tick.)

IMPORTANT: Have you shared your printer…? I mentioned this in a previous post, but forgot to mention it in my most recent one, Doh!

If you can let the know the error message that appears in the console that would great (as I’m unable to test this otherwise). Andy.

0 Likes

#64

I do have printer sharing turned on (although this doesn’t seem to affect anything; I tried it both ways). Here’s what I find when I start up ST and look at the console:

[quote]
Reloading plugin /Users/bb/Library/Application Support/Sublime Text 2/Packages/QuickPrint/QuickPrint.py
Traceback (most recent call last):
File “./sublime_plugin.py”, line 62, in reload_plugin
File “./QuickPrint.py”, line 8, in
os.environ’COMPUTERNAME’])
File “/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/UserDict.py”, line 22, in getitem
raise KeyError(key)
KeyError: ‘COMPUTERNAME’
plugin init time: 0.041403
loading bindings
loading pointer bindings
found 1 files for base name Default.sublime-theme
theme loaded
app ready
pre session restore time: 0.158148
using gamma: 2 (err: 6.9282)
startup cache, total files: 94 cache hits: 94
startup time: 0.261773 (package setup was not run)
loaded 837 snippets[/quote]

Hope this helps.

0 Likes