@PeterJones said:
@Mark-Olson, @AlanRobbo-69,
I have an initial implementation available through the GitHub action build for now (https://github.com/pryrt/notepad-plus-plus/actions/runs/26252176986#artifacts – artifacts should be there in a few minutes from when I post)
If you have Text Of Line[FF][EOL]NextPage then the [FF] will be the end of page1 and NextPage will be the beginning of page2
If you have Something[EOL][FF]NextPage, then the Something will be the end of page1 and [FF]NextPage will be the beginning of page2
I don’t recommend it, but Text of[FF] Line[EOL]SomethingElse will put Text of[FF] Line on page1 and SomethingElse on page2 (this is due to the fact that scintilla will always go to the end of the line, even if it goes beyond the “end position” that you passed it, and it doesn’t consider FF an EndOfLine character for this purpose. That would have to be fixed in Scintilla, as there’s nothing I can do about it from the N++ end.)
View > Show Symbol: if Show Control Characters & Unicode EOL is on, then Notepad++'s display and the printed file will include the FF box-glyph. If it’s off, then neither N++ nor the printed file will show the FF box-glyph.
The option defaults to OFF. To turn it on, use Settings > Preferences > Print > Print formfeed as page break.
I hope that you (and other interested parties) would test it over the next few days. I will likely create the issue right after posting this message (update: Issue #18059), but will wait until this weekend to submit the PR, in case there are obvious things that would improve it before I submit it to the codebase.
I like your specification, @peterjones , but I am not sure if I understood the subsequent discussion of you and @coises in the right way (due to possible language barrier).
So I want to drop my 5 cent to the specification, sorry if that is even what you meant all along. But I think, it is slightly different.
My expectation/specification would be like that:
Even during printing, under no circumstances, a character is omitted at the output. So if control characters are enabled to be shown, they are also visible on the printing output. So FF should not be “cut away or replaced by page break”, but only the meaning of page break is added at the printing output.
and
The interpretation/action of a control character takes place (directly) after the position of the control character in the document (exatly like with CR and/or LF, line break is done directly after these control chars). This would be consistant behaviour of control char interpretation.
Now, if I understood correctly, it is not possible to cut/split directly after FF and send the page break to Scintilla, but only to cut/split after CR and/or LF. In this case, my specification would be:
Add page break always after the next possible CR and/or LF, means, applied to your examples:
Text: FirstText[FF][EOL]SecondText[EOL]ThirdText --> Printing Output: FirstText[FF][EOL][page break]SecondText[EOL]ThirdText
Text: FirstText[EOL][FF]SecondText[EOL]ThirdText --> Printing Output: FirstText[EOL][FF]SecondText[EOL][page break]ThirdText
Text: FirstText[EOL]SecondText[FF]ThirdText[EOL]FourthText --> Printing Output: FirstText[EOL]SecondText[FF]ThirdText[EOL][page break]FourthText
So each line is finished with an [EOL]. Control characters of another line belong to the line in which they are in, and are applied at next possible [EOL].
So, nevertheless, the standard should be to have [FF][EOL] in the document for a page break then
For me, that would be a universally applicable solution and interpretation of control characters.