Login
`
Templates, Tools and Utilities
|
||
Add a comment to an Icetips ArticlePlease add your comments to this article.
Please note that you must provide both a name and a valid email address in order
for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!
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 December 3, 2024, 11:49 am This article has been viewed 35328 times.
|
|