This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes IDEs, Version Control and other tools and the fly likes eclipse: printing line numbers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "eclipse: printing line numbers" Watch "eclipse: printing line numbers" New topic
Author

eclipse: printing line numbers

David Hibbs
Ranch Hand

Joined: Dec 19, 2002
Posts: 374
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?


"Write beautiful code; then profile that beautiful code and make little bits of it uglier but faster." --The JavaPerformanceTuning.com team, Newsletter 039.
mamashan canfield
Greenhorn

Joined: Jul 05, 2011
Posts: 2
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

    Joined: Aug 16, 2005
    Posts: 14074
        
      16

    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...


    Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
    Scala Notes - My blog about Scala
    mamashan canfield
    Greenhorn

    Joined: Jul 05, 2011
    Posts: 2
    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

    Joined: Aug 16, 2005
    Posts: 14074
        
      16

    Jeanne Boyarsky
    internet detective
    Marshal

    Joined: May 26, 2003
    Posts: 30130
        
    150

    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!


    [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
    Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: eclipse: printing line numbers
     
    Similar Threads
    NO Line Numbers in Exception!!!
    Help with Assignment 1.5 - Times
    View line numbers in JBuilder
    how to show line numbers in WSAD
    Debugging code without sources