Community
    • Login

    Pagebreaks in Notepad++

    Scheduled Pinned Locked Moved General Discussion
    19 Posts 6 Posters 7.0k Views
    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.
    • PeterJonesP
      PeterJones
      last edited by

      @Alan-Kilborn said:

      let’s see if we get some other responses.

      Well, I’ve got a convoluted workaround.

      First, a history lesson. In the old days (MS-DOS), printers were mostly looking for a raw stream of ASCII text, which they would interpret as either text or control characters – some of the control characters would move forward to the next line (CR, LF, or some combination); some would interpret FF as a form-feed, and move to the next page. Fast forward to Windows: people wanted fonts, people wanted graphics, people wanted those to print. Using fancy Windows printer drivers, applications like word processors and graphics programs would translate the fonty texts and graphical images into command the printer driver would understand, then the printer driver would change those commands into sequences that the printer would interpret (the printer wouldn’t think of most of it as text any more, just graphics). When you print from Notepad++, it goes through whatever processing Notepad++ does (including stuff so it decides how much of the syntax highlighting to propagate to the print job), then dumps that to the printer driver, and the printer driver tells the printer what it wants. So Notepad++ isn’t sending raw text to the printer.

      The good news is, many printers still come with the ability that if you dump raw text into their input, they will still behave as the old dot-matrix and print that raw text in their default font. I found a sequence that worked for me:

      SETUP

      1. Note the name of your computer. If it’s BillowPC, note that. (I will use that for my example from now on)
      2. Open up your printer properties, and go to the Sharing tab. Tell it to Share this Printer, and give it a name, like BillowPrinter. Apply and/or OK
      3. Using Windows Explorer, verify you really shared your printer by going to \\BillowPC\, and making sure there’s a printer icon for BillowPrinter.

      PRINTING

      Go to the Run > Run… menu, then enter cmd /c "copy "$(FULL_CURRENT_PATH)" \\BillowPC\BillowPrinter", and click Run to print it raw.

      AUTOMATING

      Assuming that works for you, you can turn it into a shortcut:

      • Run > Run… should still list that command
      • Save…
      • Enter a name (like Print This File Raw). Enter a keyboard shortcut.
      • OK to leave the save-dialog.
      • Run to print the file again and exit the dialog, or Cancel to leave the the Run>Run dialog (somewhat counter-intuitive, but since you’ve already saved, it’s just cancelling the running of the Print this file raw)

      The Run menu should list Print This File Raw at the end of the list of commands, and either selecting that or using the shortcut you assign will dump the bytes directly to the printer.

      Exit Notepad++ and restart (this will make sure you save your changes to the config file.)

      Final Notes

      If you’re asking yourself, “why is it so difficult”, please remember: Notepad++ is not a word processing or page layout software: it is a text editor. If you want a full-featured word processor, use one (LibreOffice is free and open source)

      Alan KilbornA 1 Reply Last reply Reply Quote 2
      • Alan KilbornA
        Alan Kilborn @PeterJones
        last edited by Alan Kilborn

        @PeterJones

        I’m surprised in your long explanation you didn’t specifically mention the “form feed” capability. I presume that the fact that the method of printing you describes “goes around” Notepad++ printing, that the method describes will do the desired form feed operation if a FF character is embedded in the document.

        Edit: concession: brief reference: “…some would interpret FF as a form-feed,…”

        1 Reply Last reply Reply Quote 0
        • Charles W BillowC
          Charles W Billow
          last edited by

          Guys, I appreciate the responses, but none seems to really answer my question/need.

          @Peter Jones: While that workaround may sort of provide a solution, it’s too bad that it needs those gyrations.

          I for years used Textpad (textpad.com). It has it’s own set of foibles, which led me to Notepad++.

          At the same time however, it can and does to two things easily that for whatever reason the developers of NP++ have chosen not to include.

          One of Print Preview (File / Print preview), a handy asset when one wants to have coding paginated a specific way.

          The other is the Page Break we speak of here ( Edit / Insert / Page Break).

          While Textpad is not free, as is Notepad++, it is relatively inexpensive at $16.50.

          In most ways I prefer Notepad++, one of which, obviously is cost. I don’t understand why though, adding these two capabilities should be out of reach, since the developers of NP++ obviously are quite adept.

          Why would I not just use Textpad one might ask, especially since I already own it? Little things I came across over the years that I seemed to find more comfortably resolved in NP++.

          Anyway…

          EkopalypseE Alan KilbornA 2 Replies Last reply Reply Quote 0
          • EkopalypseE
            Ekopalypse @Charles W Billow
            last edited by

            No offense, but why are we always think that a functionality available in one product must be also available in another? I mean, it does not make sense to have different products if those have the same functionality only.
            From my understanding I would argue that printing seems not to be something the core dev(s) really care about and that is fine. If they don’t see any obvious benefit why should they bother spending their time implementing it, which takes us to the next point. Npp is open source, so everyone wanting this functionality and are capable of doing such an implementation can contribute to the project.
            As said, no offense just my two cents.

            Alan KilbornA 1 Reply Last reply Reply Quote 3
            • Alan KilbornA
              Alan Kilborn @Ekopalypse
              last edited by

              @Ekopalypse said:

              From my understanding I would argue that printing seems not to be something the core dev(s) really care about and that is fine.

              I second this, both in sentiment and agreement that printing is not important enough to care about. If one is going to create things that are printable with a lot of options use a word processor. Or pull your Notepad++ document into a word processor for final printing.

              Looking at the OP’s posting history, however, it seems he is very obsessed with printing from Notepad++. :)

              1 Reply Last reply Reply Quote 3
              • Alan KilbornA
                Alan Kilborn @Charles W Billow
                last edited by

                @Charles-W-Billow said:

                While that workaround may sort of provide a solution, it’s too bad that it needs those gyrations.

                Notepad++ is a thing where workarounds excel! Embrace them. I didn’t try Peter’s suggested workaround, because TBH I think anything beyond what you get with a basic print in Notepad++ is silly, but it is probably a good solution that just requires a one-time set up.

                1 Reply Last reply Reply Quote 2
                • gstaviG
                  gstavi
                  last edited by

                  Did some quick research in the code.
                  As far as I can tell the module that actually prints text and decides about pages is Scintilla and not Notepad++.
                  So @Charles-W-Billow, feel free to go to Scintilla forum and ask them to respect form feeds within the printing logic (EditView::FormatRange). Specifically since printing seems to be at line resolution you would need to ask them that whenever a line contains form feed char and only form feed char Scintilla will end the current page.

                  Generally my expectation would be that surveying 100 random Notepad++ users will show that 98 of them did not use Notepad++ ‘print’ feature in the last 6 month. But I may be surprised. If printing is a major part of your work choose the easy tool for that. If you mainly edit and rarely print then it should be completely acceptable to use 2 different tools.

                  1 Reply Last reply Reply Quote 4
                  • Michael VincentM
                    Michael Vincent
                    last edited by Michael Vincent

                    surveying 100 random Notepad++ users

                    I have never used N++ to print.

                    1 Reply Last reply Reply Quote 2
                    • PeterJonesP
                      PeterJones
                      last edited by

                      @Charles-W-Billow said:

                      @Peter Jones: While that workaround may sort of provide a solution, it’s too bad that it needs those gyrations.

                      And, to quote myself:

                      If you’re asking yourself, “why is it so difficult”, please remember: Notepad++ is not a word processing or page layout software: it is a text editor. If you want a full-featured word processor, use one (LibreOffice is free and open source)

                      @Alan-Kilborn,

                      concession: brief reference: “…some would interpret FF as a form-feed,…”

                      Sorry, that was as much as I could give; while my printer yesterday did interpret the FF character as a form feed, I cannot guarantee that @Charles-W-Billow’s would. I guess I should have said the FF did work on mine, without making guarantees about behavior of other printers.

                      1 Reply Last reply Reply Quote 2
                      • Charles W BillowC
                        Charles W Billow
                        last edited by

                        OK guys. Thanks.

                        1 Reply Last reply Reply Quote 1
                        • First post
                          Last post
                        The Community of users of the Notepad++ text editor.
                        Powered by NodeBB | Contributors