06-04-2024, 10:01 AM
i think this is better
Code: (Select All)
$Color:32
$Resize:Smooth
'Resize is so we can drag/resize the screen so it fits on a monitor
PrintScreen = _NewImage(850, 1100, 32) 'to represent an 8.5" x 11" sheet of paper
Screen PrintScreen
f& = _LoadFont("arial.ttf", 18)
_Font f&
File$ = _OpenFileDialog$("Choose file to Print", _CWD$, "*.*", "Any File")
Open File$ For Binary As #1
If _FileExists(File$) = 0 Then System
Cls , White, PrintScreen
Color Black, 0
height = Int(_Height / _FontHeight(f&) - 3)
page = 1
fname$ = Mid$(File$, 1, _InStrRev(File$, ".") - 1)
Print: Print
Do
Line Input #1, temp$
'PCopy 0, 1
nline = nline + 1
Print nline; temp$
If CsrLin >= height Then 'we probably scrolled the page. Rip off this sheet of paper and start a new page!
'PCopy 1, 0
'_PrintImage PrintScreen
_SaveImage fname$ + Str$(page) + ".PNG", PrintScreen
page = page + 1
Sleep 'A break so we can see which page we just printed
Cls , White, PrintScreen
'Print temp$ ' why print again
Print: Print
End If
Loop Until EOF(1)
'PCopy 1, 0
_SaveImage fname$ + Str$(page) + ".PNG", PrintScreen
Sleep
Close
Cls , White, PrintScreen
Print "Files ready"
b = b + ...