Is it possible and by what means to issue java code in a Microsoft Word document? Thank.
It is necessary to write a beautiful report to the authorities or there to teach - as I understand it? It is done like this:
- Launch Intellij IDEA
- Load the file and type File-> Export to HTML ...
- Next, the resulting HTML is loaded into Word and we get a very presentable code, with highlighted keywords, and, if necessary, with line numbers.
- If you don’t like the formatting of the code, you can choose the style of the code, fonts, hyphenation, curly brackets, etc. through the same IDEA (via File-> Settings-> Code style).
Update For fans of Eclipse, there is a Java2HTML plugin or its version as a separate Java application that also generates HTML
Conducted an experiment:
- Opened IE
- Opened a question on a hashcode, any where the code is colored.
- Highlighted the code, pressed ctrl-c
- In the Word pressed ctrl-v
In other words, unzip the code in html, open it in the Word ...
I understand here the question is in relation to the IDE with which you work.
I work with eclipse, and for me the problem is solved like this: I copy the code directly from the IDE into word (it is copied along with the formatting). There is only one nuance: if you insert one line or a very small piece (for example, a variable name) in this case the code is obtained with a blue background (where the blue background is, rather, for all this selection). a bug or a feature I don’t know :)