Converting .java file (source code) to 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 provide it best and do this easily? Any suggestions?

For this function, I developed a LaTeX doclet. This is a Javadoc doclet, which converts the javadoc remarks to LaTeX code, and (if desired) also consists of a pretty-printed version of the source code of the documented methods.

You can then transform the created LaTeX document to PDF, and append it to your report.

Set up CutePDF if you utilize Windows. This includes a “Printer” that when you print to it asks you a file name then prints the output to a.pdf document on your difficult drive – thus it is a psuedo printer – it imitates a printer, but is actually a pdf file author.

I normally choose to set up a PDF “psuedo” printer in whatever OS I am using. That method I can utilize the print facilities of whatever app I am using (like Eclipse for example) and get the lead to PDF file.

Here is one example of a pseudo printer, this for the Windows platform. Mac OS X has actually a built in “print to PDF file” ability.

You can use doxygen to create documents for your project which can include a formatted source file listing in addition to Javadoc. doxygen can create both HTML and PDF output. You’ll require latex to produce the PDF output.

You could just paste & copy into Word (2007+) and save as PDF. It’s a little bit more uncomplicated than the file printer, and you can format your code for best outcomes in Word.

You could just paste & copy into OpenOffice/LibreOffice and export to PDF.

Another method to quite print is with IntelliJIDEA. It works also with the community edition.

It’s advisable to set up a PDF printer, in order to try hard copies without losing a great deal of paper. As soon as you’re satisfied with the result, you can print on the genuine printer. On Windows you can utilize CutePDF, on Linux Ubuntu install the plan cups-pdf with sudo apt-get install cups-pdf.

Note that IntelliJ prints the style’s background, so it’s a good idea to be on a white background to prevent wasting ink.

To print click menu File -> Print. The printer selection is in the next menu, after you continue the Print button.

Remarkably you can likewise print only the selected text, which is beneficial if you don’t wish to print import statements.

Other alternatives consist of the possibility to include line numbers, syntax highlighting and colour printing. On Linux IntelliJ 14.0.3, the default font style was a big size 14, so you may desire to change that too.

I can not discover a decent option to this.

I have to transform my source code to a PDF. No printing; simply the PDF. convert image to pdf using c# http://www.iditect.com/tutorial/image-to-pdf/

I discovered Enscript for Windows however can not get it’s overcomplicated being to work. Any aid?

pdf printer Open the java file in something like Eclipse so you can syntax highlighting, paste to Notepad++, print to pdf.

If you are utilizing a Windows OS, you can use Some Text to PDF Converter. It’s free, has a GUI and is basic to utilize.

Leave a Reply

Your email address will not be published. Required fields are marked *