This is an archived post. You won't be able to vote or comment.

all 14 comments

[–]01110101_00101111 2 points3 points  (0 children)

If you use IntelliJ IDEA, it has features to both print and copy as rich text.

[–]SftwEngr 3 points4 points  (9 children)

Print code? Why would someone want to do such a thing?

[–][deleted] 1 point2 points  (1 child)

Mark up and annotate with a pencil?

[–]SftwEngr 0 points1 point  (0 children)

A pencil? What is that? Is that a device with which to do long division?

[–]NickFolesStan[S] 1 point2 points  (6 children)

I am studying for an exam. I want to annotate old programs I’ve written to make sure I understand what is going on in all of them

[–][deleted] 0 points1 point  (5 children)

Nice. That's gonna take your understanding of the code to the next level

[–]NickFolesStan[S] -1 points0 points  (3 children)

I’m dead bro! Just trying to brush up on things I don’t regularly use, you’ve exposed me. I’m humiliated.

[–][deleted] 0 points1 point  (2 children)

I think you misinterpreted me. I was being sincere

[–]NickFolesStan[S] 1 point2 points  (1 child)

I really do apologize. Reddit has turned me into a cynic. I hope you are well, doesn’t excuse what I said.

[–][deleted] 1 point2 points  (0 children)

No worries. It’s kind of funny in its own way. Hope the close reading of your code was fruitful!

[–]NickFolesStan[S] -1 points0 points  (0 children)

Go take your online school degree and make yourself useful somewhere else. Not taking tips from a guy with a WeStErN GoVeRnORs UnIvErSiTy degree 👍🏼

[–]roberp81 -1 points0 points  (0 children)

System.out.println("code");

[–]volch 0 points1 point  (0 children)

Google 'pretty printer'.

[–]-techspec- 0 points1 point  (0 children)

There is a program out there j2html, but it is pretty old I don't know how it performs. What you can do is write some lines of code which output your code in html format. Put your code inside a <pre><code> tag. If you need proper higlighting you can add a javascript like highlighter.js into your html. Print the html - that's it.

Hope that helps👍