Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I pretty-print Java source code as a PDF?

I'm planning to put some Java code in an appendix to my report. The report is a PDF document, and I use Eclipse for Java.

How can I present it best and do this easily? Any recommendations?

like image 577
user528676 Avatar asked Aug 28 '11 17:08

user528676


2 Answers

For this purpose, I created a LaTeX doclet. This is a Javadoc doclet, which converts the javadoc comments to LaTeX code, and (if wanted) also includes a pretty-printed version of the source code of the documented methods.

You can then convert the generated LaTeX document to PDF, and append it to your report.

like image 126
Paŭlo Ebermann Avatar answered Sep 18 '22 00:09

Paŭlo Ebermann


If you use Windows, install CutePDF. This adds a "Printer" that when you print to it it asks you a file name and then prints the output to a .pdf document on your hard drive - hence it is a psuedo printer - it acts like a printer, but is really a pdf file writer.

Don't know solutions for other o/s...

like image 24
user906398 Avatar answered Sep 20 '22 00:09

user906398