none
How do you print in Visual Studio Code?

All replies

  • Hi,

    Console.WriteLine("Text to print");

    Thanks, Please mark this answer if helpful.


    • Edited by Shafiq Abbas Saturday, February 13, 2016 12:10 PM
    Saturday, February 13, 2016 12:10 PM
  • The question is simple.  How can you print from within Visual Studio Code?

    Do you mean print to screen or print to a printer ?


    n.Wright

    Saturday, February 13, 2016 7:51 PM
  • I would like to know how to print the program I'm editing with VS Code to a printer
    Friday, June 17, 2016 6:49 PM
  • Apparently microsoft took a page from Sublime Text and decided that actually printing something out is a low priority, outdated use for a TEXT EDITOR.

    In short, doesn't look like you can print to a printer at all with it.  But, as some "brilliant" person said on a similar topic for Sublime, just copy it into an editor that can print and print from that!

    Friday, September 16, 2016 7:49 PM
  • Simple answer: Visual Studio Code does not print :(


    • Edited by Hanko Panko Friday, December 9, 2016 11:09 PM
    Friday, December 9, 2016 11:09 PM
  • In this case I recommend use Notepad++. I have the portable version only to print my codes.
    Friday, February 24, 2017 10:14 PM
  • The question is simple.  How can you print from within Visual Studio Code?

    If you use google drive, you can right click on the file in explorer and select Google Drive->View on the web and then print it.

    John

    Tuesday, August 15, 2017 7:16 PM
  • Agreed, this is completely insane

    Were the M$ devs smoking something or perhaps just had a common sense bypass?

    Saved me the time searching anyway!

    Sunday, October 22, 2017 2:24 PM
  • I need to do this as well. Copy paste won't work as I want to keep the same format, font, colours etc. 
    Monday, October 30, 2017 5:08 PM
  • Agreed, this is completely insane

    Were the M$ devs smoking something or perhaps just had a common sense bypass?

    I'm sure the money-hungry M$ corporation would happily refund the money you spent on this free product.
    Monday, October 30, 2017 6:28 PM
  • So are you suggesting that since the program is free we should all just hold hands and drink the kool-aid when it lacks features that even the most basic text editor on the planet should include?

    I like VS Code. A lot. But the lack of a printing functionality is just bone headed and dumb. Since they seem to be following in the footsteps of Sublime and Atom on this I am going to assume that some hipster "modern" web developer made the assumption that since most people use electronic devices no one would ever actually want a hard copy. I expect this from the Sublime and Atom crowd. I also expect the guys at Microsoft to be a little more old school and exercise some common sense.

    For those reading this that are fortunate enough to use VS Code on Linux, most Linux distros include the 'lpr' utility by default, which prints to the default system printer. Typical usage is ```lpr <filename>``` or ```lpr filename -o page-ranges=2-6>```

    This should work fine from the embedded terminal in VS Code. Might even work on one of those cutesy coffee shop laptops. Not sure if the Jobsians stripped lpr out of OSX.

    Wednesday, November 8, 2017 8:11 PM
  • It's insane, but... In Windows, select all text (CTRL+A) and Copy&paste into Word, which retains the formatting.  "Landscape Orientation" and "Narrow Margins" looks best.
    Wednesday, January 3, 2018 7:20 PM
  • I use an extension.

    Its called "PrintCode"

    When you have installed it you just have to type "PrintCode" in the command lane (F1) and you will be able to print it out.

    • Proposed as answer by Dan Ignat Tuesday, March 13, 2018 9:19 AM
    Saturday, January 6, 2018 3:33 PM
  • I agree. Nearly all programs have a File -> Print option. I don't understand why I just simply can't print a file in VS Code (you can in Visual Studio 2017).

    Microsoft, you missed the mark here!


    • Edited by R. Mayerik Tuesday, January 23, 2018 1:45 PM
    Tuesday, January 23, 2018 1:43 PM
  • That prints the source. If you need to print the preview (e.g., for a Markdown document) what can you use?
    Wednesday, April 4, 2018 5:08 PM
  • If you have a different default browser from Chrome, you need to do this in your User Settings to set the printcode.browerPath: 
    "printcode.browserPath": "/Program Files (x86)/Google/Chrome/Application/chrome.exe"


    Dan Randolph - My Code Samples List

    Wednesday, April 11, 2018 4:30 PM
  • Did not work for me. The "print" function from PrintCode in Vcode merely opened an empty IE tab.

    How the heck do you do that.

    Anyway, opened in NP++ and printed perfectly. ---- bizarre font here change after cut/pasting from above. Could it be the PrintCode boys getting revenge?

    .

    Wednesday, April 18, 2018 2:41 AM
  • Just plain dumb that a print feature is not in Visual Studio Code.
    Wednesday, April 18, 2018 5:24 PM
  • An extension makes sense to me so that those who don't need this functionality don't have to carry the memory footprint with them everywhere ... lean and mean coding editing machine!
    Saturday, May 5, 2018 8:27 PM
  • I have install on my computer IDLE 3.7. If you open with it you have a print windows option under the File tab or short cut CTRL+P.
    Saturday, September 15, 2018 3:33 PM
  • clone your file in a GitHub repository

    open the file in Github and print (right-click)

    Sunday, October 14, 2018 6:10 PM
  • Simple answer - Microsoft have decided not to include this functionality.  Strangely enough, the first thing I wanted to do after installing VSC was print out a few pages of code so that I could read them and spot where my errors were (I can't always spot them on screen, don't ask me why).  So, next time I switch the machine on, the first thing I will be doing is uninstalling VSC...
    Wednesday, November 14, 2018 12:03 PM
  • The PrintCode extension mentioned in this thread works for me.
    It works best of your default browser is Chome I think.

    It is not perfect, for example, it can only print in portrait mode.
    But it works well for me.

    Friday, November 16, 2018 11:43 AM