• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

eclipse: printing line numbers

 
David Hibbs
Ranch Hand
Posts: 374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can easily print from WSAD/Eclipse, but does anyone know how to get it to print the line numbers too--just like it appears when you turn on the line numbering option in the editor options?
 
mamashan canfield
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Hibbs wrote:I can easily print from WSAD/Eclipse, but does anyone know how to get it to print the line numbers too--just like it appears when you turn on the line numbering option in the editor options?


I know this post is quite old, but I am new to programming and had this same question and found several answers or solutions that made the process more complicated than necessary, such as an online applet, which didn't work.

I found that a simple copy and paste into Microsoft Word worked best.

  • From the file window in Eclipse, Select All (Ctrl A), Copy (Ctrl C)
  • Open a new blank document in Microsoft Word
  • Paste (Ctrl V) to paste code into the document
  • Click on the Page Layout Tab and select Line Numbers>Continuous

  • This will add continuous line numbers to the left of your code that
    will match the line numbers in Eclipse.

    Now you can print a hard copy of the code with the line numbers
    and syntax color coding, tabs and all, from Microsoft Word.
     
    Jesper de Jong
    Java Cowboy
    Saloon Keeper
    Posts: 15216
    36
    Android IntelliJ IDE Java Scala Spring
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Welcome to the Ranch, mamashan canfield!

    Thanks for your answer. Please note that David asked his question almost 8 years ago. He is probably not still waiting for an answer...
     
    mamashan canfield
    Greenhorn
    Posts: 2
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Jesper de Jong wrote:Welcome to the Ranch, mamashan canfield!

    Thanks for your answer. Please note that David asked his question almost 8 years ago. He is probably not still waiting for an answer...


    Thanks and yes I do realize that, but the way I found the topic was through a Google Search "print line numbers in eclipse". Since this post did not give a solid solution, even though it is 8 years later, I thought it would be helpful to add a solution for others that might Google the same query.
     
    Jesper de Jong
    Java Cowboy
    Saloon Keeper
    Posts: 15216
    36
    Android IntelliJ IDE Java Scala Spring
     
    Jeanne Boyarsky
    author & internet detective
    Marshal
    Posts: 34218
    341
    Eclipse IDE Java VI Editor
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    mamashan canfield wrote:Thanks and yes I do realize that, but the way I found the topic was through a Google Search "print line numbers in eclipse". Since this post did not give a solid solution, even though it is 8 years later, I thought it would be helpful to add a solution for others that might Google the same query.

    It is! Thanks for posting the answer!
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic