如何在A3页上打印Java代码避免换行

发布于 2024-10-01 09:39:18 字数 122 浏览 1 评论 0原文

我必须在 A3 纸上打印有时达到 300 列(每行字符)的 Java 代码,并且我使用的任何编辑器(例如 textmate)都会将这些行换行以便适合 A4 纸。

有什么建议吗?

干杯, 阿斯特里奥斯

I have to print Java code that some times reaches 300 columns (characters per line) in A3 paper and whatever editor I use (e.g. textmate) wraps the lines in order to fit in A4 paper.

Any suggestions?

cheers,
Asterios

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

愚人国度 2024-10-08 09:39:18

毫无疑问,您的编辑器具有页面设置对话框或首选项对话框作为打印对话框的一部分,这将允许您设置用于打印的纸张尺寸。

连记事本都支持这个

Your editor undoubtably has either a Page Setup dialog or a Preferences dialogue as part of the Print Dialogue which will allow you to set the Paper Size to use for printing.

Even Notepad supports this

椵侞 2024-10-08 09:39:18

我终于使用 enscript 进行了打印。这是我用来将 Java 代码打印为 PDF 的命令(并使用 pdf 进行打印)。

enscript -r -Ejava -M A3 -C -f "Courier8" input.java -o - |  ps2pdf - output.pdf

其中:

  • -r 以横向模式打印
  • -C 打印行号
  • -f 更改字体和大小
  • -M 将输出介质设置为 A3(默认为 A4)
  • -Ejava 添加语法突出显示(如果需要,也可以使用 --color
    语法高亮中的颜色但是
    它们印刷得不好
    灰度)

I finally made it to print using enscript. Here is the command I used to print Java code into PDF (and the used the pdf to print).

enscript -r -Ejava -M A3 -C -f "Courier8" input.java -o - |  ps2pdf - output.pdf

where:

  • -r prints in landscape mode
  • -C prints the line numbers
  • -f changes the font and size
  • -M sets the output media to A3 (default is A4)
  • -Ejava adds syntax highlighting (you can also use --color if you need
    colors in syntax highlighting but
    they are not nicely printed in
    greyscale)
山有枢 2024-10-08 09:39:18

似乎不太可能每个编辑都尝试使用 A4 格式。您还尝试过其他哪些编辑器? Textmate没有页面大小选项吗? (嗯...似乎不是

尝试使用其他可以设置页面大小的编辑器。词,甚至。

It seems unlikely that every editor tries to format for A4. Which other editors have you tried? Does textmate not have a page size option? (Hmm... seems not)

Try a different editor that does let you set page size. Word, even.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文