chr(12) Form Feed in Notepad (Windows)

W. eWatson wolftracks at invalid.com
Fri Jan 15 22:14:20 CET 2010


Tim Chase wrote:
> W. eWatson wrote:
>> Grant Edwards wrote:
>>> On 2010-01-15, W. eWatson <wolftracks at invalid.com> wrote:
>>>
>>>> I thought I'd put a page break, chr(12), character in a txt
>>>> file I wrote to skip to the top of the page. It doesn't work.
>>>> Comments?
>>> Yes, it does work.
>>>
>> Apparently not with with my Brother 1440 laser printer. The character 
>> in NotePad.txt looks like a small rectangle, and on the printed page. 
>> Same result HP C6180 Photosmart.
> 
> But are you sending the raw control codes to the printer, or are you 
> sending the image-of-my-text-document to a printer-GDI which then 
> renders the as-you-see-it out of the printer?
> 
> The pseudo-pipeline comparison would be
> 
>   type file.txt > lpt1:
> 
> which would send the raw text file to the printer (assuming it's set up 
> on LPT1, otherwise, use whatever port it's attached to in your printer 
> control panel); or are you using something like
> 
>   notepad file.txt
>   File -> Print
> 
> which renders to an internal image representation and then sends that 
> image out to the printer.  If it were a dot-matrix printer, you'd 
> here/see the difference in a jiffy -- the raw dump is fast and uses the 
> printer's built-in fonts while the render-as-image is slow and NOISY.
> 
> One alternative is possibly to set up the "Generic Text" printer as a 
> device type and attach it to the same port; I've had fair fortune with 
> this letting me control the printer more directly if I want fast dumps 
> (particularly on dot-matrix printers) rather than pretty dumps.
> 
> -tkc
> 
> 
> 
I should mention I'm using Windows. I just put chr(12) right in the txt. 
It's the first character in the next line of the txt file where I want 
to page forward. Not acquainted with GDI. Maybe I need some sequence of 
such characters?



More information about the Python-list mailing list