在 Windows 上打印源代码

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1312172/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 06:40:33  来源:igfitidea点击:

Printing source code on Windows

windowsprinting

提问by Greg

What is the best Windows program to print out source code (more generally, text files)? I'd like the following features:

打印源代码(更一般地,文本文件)的最佳 Windows 程序是什么?我想要以下功能:

  1. Includes line numbers
  2. Option of printing 2 or 4 pages on a single sheet of paper.
  3. Header includes filename and timestamp.
  1. 包括行号
  2. 可选择在一张纸上打印 2 页或 4 页。
  3. 标头包括文件名和时间戳。

采纳答案by Breakthrough

Notepad++is an excellent tool for this (and it's free!). You can print the code out both in normal text, as well as marked-up with colour as you see it on the screen!

Notepad++是一个很好的工具(而且它是免费的!)。您可以将代码打印为普通文本,也可以用您在屏幕上看到的颜色进行标记!

回答by Bram

I tried the suggested Notepad++ and Codex, but I find them too limiting. I could not print two columns per sheet in either one of them. I like to maximize the amount of code per sheet. A decade ago I would use pcps to print multiple columns of source code, but that software is just too old and cumbersome in this day and age. For now, I would suggest this, if you want multi column output: http://www.lerup.com/printfile/

我尝试了建议的 Notepad++ 和 Codex,但我发现它们太局限了。我无法在其中任何一个中每张纸打印两列。我喜欢最大化每张纸的代码量。十年前,我会使用 pcps 打印多列源代码,但该软件在当今时代太陈旧和笨重了。现在,如果您想要多列输出,我建议这样做:http: //www.lerup.com/printfile/

回答by RiddlerDev

UltraEdit works pretty well for all three of those.

UltraEdit 对所有这三个都非常有效。

www.ultraedit.com

www.ultraedit.com

回答by cori

I use Contextfor most of my non-Visual Studio development, and it does what you asked for and is free. I don't know how well it does color, but the source code colors print in a couple of varying boldnesses, which makes it pretty readable in black and white.

我在大多数非 Visual Studio 开发中使用Context,它可以满足您的要求并且是免费的。我不知道它的颜色表现如何,但是源代码颜色以几种不同的粗体打印,这使得它在黑白中非常易读。

I just use the printer dialog to set the multi-pages per sheet option.

我只是使用打印机对话框来设置每张纸多页选项。

回答by dengel

I'm using Codex: http://www.snapfiles.com/get/codex.html

我正在使用 Codex:http: //www.snapfiles.com/get/codex.html

Works pretty good, can both print and publish (export to HTML).

效果很好,可以打印和发布(导出为 HTML)。

回答by dengel

Crimson Editorlooks great too!

Crimson 编辑器看起来也很棒!