Is there a way to copy code from eclipse including ine numbers

mrt181 picture mrt181 · May 20, 2010 · Viewed 7.6k times · Source

I am writing a little bit of documentation and code explanation. I would like to copy code from eclipse including line numbers, so that it becomes easier to reference the code in the text.

Is there any way to do this in eclipse or some other IDE, editor?

Answer

VonC picture VonC · May 20, 2010

Since Eclipse 3.4 and bug 19602, you will print the line numbers if you have activated them on the Eclipse editor.

alt text http://img706.imageshack.us/img706/7605/eclipseshowlines.png

Printing a source will give you:

alt text http://img341.imageshack.us/img341/9899/eclipseprint.png