如何从VsCode打印文件?

Eri*_*sot 47 printing visual-studio-code

我想将我正在编辑的文件发送到打印机,就像我在Notepad ++中所做的那样.我没有在打印命令上找到任何提示.这不可能吗?

Eri*_*sot 35

它尚不可用,但我找到了该功能的问题报告.

它目前处于积压状态,因此我们很快就能期待它.

https://github.com/Microsoft/vscode/issues/5953

编辑:在此期间:https://marketplace.visualstudio.com/items? itemName = nobuhito.printcode

  • 2023 年你好……我们仍在期待它很快™ (11认同)
  • 截至2020年9月15日,“很快”似乎还很遥远。相反,前面提到的扩展,非常可悲。 (9认同)
  • 截至2021年11月25日,“很快”还很遥远。 (9认同)
  • 三年过去了... (5认同)
  • 现在已经 2022 年了,问题仍然悬而未决 :D (3认同)
  • 现在已经是 2023 年 6 月,该问题仍然悬而未决,“nobuhito.printcode”现已弃用。(替换为“pdconsec.vscode-print”) (3认同)

小智 22

现在您可以为VS Code安装插件 - 搜索"PrintCode".


And*_*eña 7

现在有一个扩展可用于从 VS Code 编辑器进行打印。它称为VS Code Printing Free。我已经尝试了几天并且效果很好。

  • 我已将名称缩短为*打印* (3认同)

Pet*_*one 6

我发现PrintCode扩展令人鼓舞,但未完成,存在许多缺陷。特别是,它取决于要包装的特定纸张尺寸,因此,如果您在打印对话框中更改纸张尺寸或方向,效果会不佳。

It's open source so I looked at the code and didn't like that either. No programmer ever likes another's coding style. So I pinched the idea of using a web-browser as platform driver for HTML printing -- my hat is off to the PrintCode author for that cunning insight -- and wrote my own.

In the process I fixed all the known bugs, added everything on my wishlist and a couple of things suggested by others. The biggest thing was figuring out the CSS required to respect print dialog paper size and orientation. This also sorts out the mysterious disappearing line numbers problem, although I'm not sure why. The next biggest thing was learning to probe for an unused port, a problem that also afflicts PrintCode causing the browser to open showing no content.

If you want to survey your options, get onto https://marketplace.visualstudio.com, choose the Visual Studio Code tab and search for printing.

If you just want a link to my version, it's here http://marketplace.visualstudio.com/items?itemName=pdconsec.vscode-print.

If you like what you see but need something I haven't thought of, the marketplace page has a link to the repo on github. Create an issue and tell me what you need -- or write it yourself and submit a PR.

  • 我_have_把它放在市场上。直接链接到我自己的作品似乎有点接近垃圾邮件。由于您特别要求我的版本,这里是:http://marketplace.visualstudio.com/items?itemName=pdconsec.vscode-print (3认同)