Home Download Buy Blog Forum Support

Printing from sublime

Re: Printing from sublime

Postby japatu on Thu Sep 06, 2012 9:22 pm

I would love a print option!

Having to cut and paste into another editor kinda makes me grumpy O,,,;,,,O
japatu
 
Posts: 1
Joined: Thu Sep 06, 2012 9:21 pm

Re: Printing from sublime

Postby wkinaustx on Tue Sep 25, 2012 9:36 pm

Please, add 'print' feature
wkinaustx
 
Posts: 1
Joined: Tue Sep 25, 2012 9:34 pm

Re: Printing from sublime

Postby trentdecamp on Wed Nov 14, 2012 12:40 am

+1 for printing.

Trying really hard to like this editor, but darn you are making it difficult.....please
trentdecamp
 
Posts: 2
Joined: Wed Nov 14, 2012 12:37 am

Re: Printing from sublime

Postby zchrykng on Thu Nov 15, 2012 7:49 pm

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.
zchrykng
 
Posts: 14
Joined: Wed Jan 04, 2012 9:25 pm

Re: Printing from sublime

Postby agibsonsw on Thu Nov 15, 2012 11:39 pm

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

Code: Select all
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.
Attachments
quickp2.png
quickp2.png (69.53 KiB) Viewed 2091 times
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
agibsonsw
 
Posts: 901
Joined: Fri Jan 27, 2012 9:11 pm

Re: Printing from sublime

Postby agibsonsw on Fri Nov 16, 2012 7:40 pm

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 ;)

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

Added: It may not accept a printer-name containing spaces currently. You could rename the printer temporarily without spaces.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
agibsonsw
 
Posts: 901
Joined: Fri Jan 27, 2012 9:11 pm

Re: Printing from sublime

Postby agibsonsw on Fri Nov 16, 2012 11:51 pm

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.)
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
agibsonsw
 
Posts: 901
Joined: Fri Jan 27, 2012 9:11 pm

Re: Printing from sublime

Postby agibsonsw on Sat Nov 17, 2012 5:37 pm

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 ;)

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.
Attachments
quickp3.png
quickp3.png (64.71 KiB) Viewed 2012 times
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
agibsonsw
 
Posts: 901
Joined: Fri Jan 27, 2012 9:11 pm

Re: Printing from sublime

Postby agibsonsw on Sat Nov 17, 2012 10:57 pm

This is cool 8-) 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.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
agibsonsw
 
Posts: 901
Joined: Fri Jan 27, 2012 9:11 pm

Re: Printing from sublime

Postby agibsonsw on Sun Nov 18, 2012 5:42 pm

// 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.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
agibsonsw
 
Posts: 901
Joined: Fri Jan 27, 2012 9:11 pm

PreviousNext

Return to Technical Support

Who is online

Users browsing this forum: tommyp and 35 guests