Login
`
Templates, Tools and Utilities
|
||
![]() |
![]() |
Icetips Article
Back to article list
Search Articles
Add Comment
Printer friendly
Direct link
Par2: Print directly to printer 2003-12-08 -- Bjarne Havnen If you don't need that much format, it is pretty easy to print line by line
to a printer. The following takes an ascii file, opens, reads and prints
each line to the printer. Pretty easy to modify to i.e. a queue of data. It
may be a problem with ascii vs. printerfonts regarding special characters.
(Norwegian characters æoå I had to translate differently for different
printers.)
!Global map
Module('win32')
openprinter(*cstring,*unsigned,ulong),bool,pascal,raw,name('openprintera')
startdocprinter(unsigned,byte,*doc_info_1),bool,pascal,raw,name('startdocpri
ntera') !*
enddocprinter(unsigned),bool,pascal,raw
writeprinter(unsigned,string,long,*long),bool,pascal,raw
startpageprinter(unsigned),bool,pascal,raw
endpageprinter(unsigned),bool,pascal,raw
closeprinter(unsigned),bool,pascal,raw
End
!Global data
DOC_INFO_1 GROUP ,Type
pdocname Long
poutputfile Long
pdatatype Long
END
The procedure
PrintAsciiApi PROCEDURE (String pFilename,
Today is March 31, 2025, 12:00 pm This article has been viewed 35452 times.
|
|