Request for local printing


i’ve posted here before inquiring about local printing (Printing on a local printer) and gotten a helpful response, but it would be SO much better if the facility were easily available in the workspace IDE. Just my (request for) 2 cents…david

Print Function for the IDE?

See my suggestion at this post: Printing on a local printer


Sometime ago there was a similar request for ace, if you want to print highlighted code to pdf the code for a plugin or init script is very simple

    name: "print",
    isAvailable: function(editor) {
        var tab = services.tabManager.focussedTab
        return tab && tab.editor.ace
    exec: function() {
        var tab = services.tabManager.focussedTab;
        require("ace/config").loadModule("ace/ext/static_highlight", function(m) {
            var editor = tab.editor.ace
            var result = m.renderSync(
            var d = document.createElement("div")

            setTimeout(function() {window.print()}, 10)

            function restore() {
               window.removeEventListener("focus", restore, false)
            window.addEventListener("focus", restore, false)
            d.onclick = restore
}, plugin)


thanks very much, this looks very promising, but i have absolutely no idea how this works. I tried cutting the snippet that you list here and executing it in my chrome browser console, but got an error “services undefined”…

where the heck does this snippet go and what specifically will it do? thanks for any context you can provide… :slightly_smiling: …david


add it to init script
then after reloading page open commands panel and choose print


AWESOME…you made my day! because not only did you solve my immediate problem, but you pointed out a whole aspect of Cloud9 of which i hadn’t been aware. I have only been using C9 for a few days and have found it to be great, but this is even better! thanks again…david


For future readers check out this plugin:

closed #8