Community
    • Login

    How do I convert a Notepad++ texst file to a PDF file with the vertical spacing bvetween the lines staying the same?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 3 Posters 1.6k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Maxim RodinM Offline
      Maxim Rodin
      last edited by

      I’m using Notepad++ to write a book. The book uses box drawing characters, which require the vertical spacing between lines to be very small. All of this needs to be exported in PDF format, but when I open the resulting PDF file, the vertical spacing is very high. Is there any way to fix this, either in Notepad++ or in the finished file?

      Mark OlsonM PeterJonesP 2 Replies Last reply Reply Quote 0
      • Mark OlsonM Offline
        Mark Olson @Maxim Rodin
        last edited by

        @Maxim-Rodin
        Feels to me like this is something that could be done with LaTeX. I’m not an expert or anything, but I know for a fact that math textbooks with all sorts of weird formulas and whatnot are written in LaTeX.

        In any case, the Notepad++ community forum is not really the place to ask for help on conversion of some arbitrary text document to a PDF, since Notepad++ has no built-in faculties for such a conversion. If you’re trying to “Print to PDF”, that’s a separate program that Notepad++ is interfacing with, and you’d want to look at documentation on how to print to PDF on Windows.

        1 Reply Last reply Reply Quote 1
        • PeterJonesP Offline
          PeterJones @Maxim Rodin
          last edited by PeterJones

          @Maxim-Rodin said in How do I convert a Notepad++ texst file to a PDF file with the vertical spacing bvetween the lines staying the same?:

          The book uses box drawing characters, which require the vertical spacing between lines to be very small. All of this needs to be exported in PDF format, but when I open the resulting PDF file, the vertical spacing is very high. Is there any way to fix this, either in Notepad++ or in the finished file?

          The problem might be the font you are using. When I use Fira Code as my font, print some box-drawing to PDF, and then open it in my free SumatraPDF viewer, the spacing looks reasonable (the boxes all connect) – the following is a screenshot from my PDF viewer

          33fe7d55-14fc-41e1-bfb3-d121f83b1563-image.png
          … So it’s showing them still connected.

          (Here’s NPP screenshot before I printed to PDF:
          ee7458bc-e218-417f-8fcd-5235c2f764ce-image.png
          … it shows connected there, too)

          Also, if that’s not working for you, if you take your text file in Notepad++ and use Language > M > MS-DOS Style (which is the lexer that’s useful for the old ASCII art .nfo-style files… though .nfo doesn’t seem to be in my default extension list anymore, which surprised me), Notepad++ actually changes the line spacing to make the lines closer together. So if changing fonts doesn’t work for you, try printing when in the Language = MS-DOS Style.

          Finally, the Settings > Preferences > MISC has some “DirectWrite” or “Rendering mode” settings (depending on which version of Notepad++ you are using) – you can try the various options available to you, as that influences how Notepad++ and the OS interface when dealing with fonts, so that can influence it. You may need to exit and restart Notepad++ for the DirectWrite setting change to take effect.

          For example, in my tests with Fira Code font, if I had Language = “MS-DOS Style” but “Rendering Mode” set to “Direct Write (default)”, I would see gaps, even though in Language = “None (normal text)”, I wouldn’t see gaps. If I change to “Rendering Mode” = “GDI (most compatible)” (or DirectWrite=off in the old nomenclature) and restart and look at the box drawing in “MS-DOS Style”, it goes back to being connected. But my experience may be different than yours, because as I said, when I use FiraCode in my normal setup, the box drawing characters are properly connected.

          In general, Notepad++ tries to print essentially what you see (in terms of font size, line spacing, etc), so if you see the box drawing connected when looking at it on-screen in Notepad++, it should print to PDF (or physical printer) that way, too. If not, it might be your printer driver, or you might need to change your font and/or DirectWrite settings.

          1 Reply Last reply Reply Quote 4

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors