devxlogo

Writing directly to a printer

Writing directly to a printer

Question:
How to write a text directly to printer port, such as lpt1?

Answer:
While there is no standard method of writing directly to a printer, you can try writing to stdprn. Some compilers define this additional file descriptor which is assigned by to the default printer. For example:

fprintf(stdprn, "hello);

devx-admin

Share the Post: