Home Download Buy Blog Forum Support

printing possibility - txtPrint

printing possibility - txtPrint

Postby barbedCoil on Wed Apr 11, 2012 11:50 pm

I have used this in the past with Notetab light to print all types of formats - essentially it looks like Notetab light would send txtPrint the name of the file to print:

http://sourceforge.net/projects/txtprint/

Is there some plugin already in existence or command that would enable to call out to this external tool to print?

I just started using Sublime about 3 days ago so forgive the lack of knowledge

Not having printing is a major issue for me - I did not realize the editor would NOT have printing - never gave it a thought as it is such a simple thing

Any comments or ideas would be great
barbedCoil
 
Posts: 3
Joined: Wed Apr 11, 2012 11:47 pm

Re: printing possibility - txtPrint

Postby facelessuser on Thu Apr 12, 2012 3:23 am

agibsonw and I have been throwing together a plugin to do just this (amongst other things).

Download zip at https://github.com/facelessuser/PrintHtml (mine is not the default branch; mine is a fork of agibsonw 's, but mine automatically pops up the print dialog in the web brower; agibsonw hasn't pulled it in yet).

Make sure the plugin is in Packages/PrintHtml (in the zip file it will be named something else)

Put this in Packages/User/Default.sublime-commands. I picked a theme with a white background for printing.
Code: Select all
    {
        "caption": "Print: Print in Broswer",
        "command": "print_html",
        "args": {"numbers": true, "browser_print": true, "color_scheme": "Packages/Color Scheme - Default/Mac Classic.tmTheme"}
    },


It is fairly configurable, and it is currently under heavy development, so things might change. But this will allow you to execute the "Print: Print in Browser" command from the command palette. It will convert your view into an HTML file and open it in your default HTML application (it should be a web browser). And it will popup your browsers print dialog.
Last edited by facelessuser on Thu Apr 12, 2012 5:38 pm, edited 1 time in total.
facelessuser
 
Posts: 1565
Joined: Tue Apr 05, 2011 7:38 pm

Re: printing possibility - txtPrint

Postby facelessuser on Thu Apr 12, 2012 4:52 am

Looks like there is also this plugin as well https://github.com/svenax/SublimePrint, so there are options.
facelessuser
 
Posts: 1565
Joined: Tue Apr 05, 2011 7:38 pm

Re: printing possibility - txtPrint

Postby barbedCoil on Thu Apr 12, 2012 3:06 pm

Very cool! I used to write Python code so I have been looking at the plugin API to see what's involved - I will give it a try - thanks!

facelessuser wrote:abigsnow and I have been throwing together a plugin to do just this (amongst other things).

Download zip at https://github.com/facelessuser/PrintHtml (mine is not the default branch; mine is a fork of abigsnow's, but mine automatically pops up the print dialog in the web brower; abigsnow hasn't pulled it in yet).

Make sure the plugin is in Packages/PrintHtml (in the zip file it will be named something else)

Put this in Packages/User/Default.sublime-commands. I picked a theme with a white background for printing.
Code: Select all
    {
        "caption": "Print: Print in Broswer",
        "command": "print_html",
        "args": {"numbers": true, "browser_print": true, "color_scheme": "Packages/Color Scheme - Default/Mac Classic.tmTheme"}
    },


It is fairly configurable, and it is currently under heavy development, so things might change. But this will allow you to execute the "Print: Print in Browser" command from the command palette. It will convert your view into an HTML file and open it in your default HTML application (it should be a web browser). And it will popup your browsers print dialog.
barbedCoil
 
Posts: 3
Joined: Wed Apr 11, 2012 11:47 pm

Re: printing possibility - txtPrint

Postby barbedCoil on Thu Apr 12, 2012 3:07 pm

I saw this but could not make it work - I will re-visit - thanks

facelessuser wrote:Looks like there is also this plugin as well https://github.com/svenax/SublimePrint, so there are options.
barbedCoil
 
Posts: 3
Joined: Wed Apr 11, 2012 11:47 pm

Re: printing possibility - txtPrint

Postby agibsonsw on Thu Apr 12, 2012 3:09 pm

@fosslissbunder

abigsnow


?
"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 possibility - txtPrint

Postby facelessuser on Thu Apr 12, 2012 5:38 pm

agibsonsw wrote:@fosslissbunder

abigsnow


?


Couldn't remember how to spell your name and I was too lazy to look it up...gibson. That makes much more sense than bigsnow. :) Now corrected.
facelessuser
 
Posts: 1565
Joined: Tue Apr 05, 2011 7:38 pm


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 8 guests