473,385 Members | 1,373 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Sending a file to the printer, how?

Hello all,

Say I have a file called "error.log" that I wish to send to the
printer. How would I print the file to the printer? I found out I can
use the SYSTEM function and send a command like

PRINT error.log

but that command is displayed on the screen which I don't want. I
would rather use some sort of c rountine if possible. I am using
Microsoft C v6.00. Any help is greatly appreciated. Thanks!!!

Mark
Nov 13 '05 #1
5 6386
Lord writes:
Say I have a file called "error.log" that I wish to send to the
printer. How would I print the file to the printer? I found out I can
use the SYSTEM function and send a command like

PRINT error.log

but that command is displayed on the screen which I don't want. I
would rather use some sort of c rountine if possible. I am using
Microsoft C v6.00. Any help is greatly appreciated. Thanks!!!


You might look into the echo command. Please restrict any follow ups to
platform oriented newsgroups, distribution trimmed.
Nov 13 '05 #2
Lord <Id***@hotmail.com> wrote:
Say I have a file called "error.log" that I wish to send to the
printer. How would I print the file to the printer?
<http://www.eskimo.com/~scs/C-faq/q19.8.html>.
I found out I can use the SYSTEM function


There is no SYSTEM function. C is case-sensitive: that function is
called system.

Richard
Nov 13 '05 #3
Lord wrote:
Hello all,

Say I have a file called "error.log" that I wish to send to the
printer. How would I print the file to the printer?

fopen the log file for input
fopen the printer
loop
read log file, if finished break
write to printer
endloop
fclose the log file
fclose the printer

remember to add appropriate error checking.


--
Martin Ambuhl

Nov 13 '05 #4
printer. How would I print the file to the printer? I found out I can
use the SYSTEM function and send a command like

PRINT error.log

but that command is displayed on the screen which I don't want. I but try this:

PRINT error.log >nul

or

COPY error.log PRN >nul

would rather use some sort of c rountine if possible. I am using
Microsoft C v6.00. Any help is greatly appreciated. Thanks!!!


open the outputfile as PRN (default printer port) and then you had to send
the data to the port and close it.

best greetings,
Aleksander

Nov 13 '05 #5

"Lord" <Id***@hotmail.com> wrote in message

I would rather use some sort of c rountine if possible. I am using
Microsoft C v6.00. Any help is greatly appreciated. Thanks!!!

You need to look up "printing" in your documentation. Unfortunately ANSI C
doesn't provide any portable printer functions, and platform-specific ones
tend to be rather complex to use because they have to deal with different
types of printer, sharing the printer with other programs or machines,
different paper sizes, graphic capabilities, and so forth.

Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: MouseHart | last post by:
I have written a small VB program which lists my music files on my computer, but I can't get it to print exactly the way I want it to. The data is viewed on screen in an MSFlexGrid named...
4
by: Peter Haider | last post by:
Hi newgroup, i struggle with a problem with windows 2000 fax server running under my ASP Web application The sending of an fax - like the example below - works manually very well (with file...
0
by: news.microsoft.com | last post by:
Hi Everyone, I am using the API of a particular printer driver, to pre-specify settings specific to that printer driver. After which the API has methods to create a printer driver context, which...
3
by: Vlki | last post by:
Hello, I can't find a way to send printer specific language codes to printer. Part of my code : String sString = "B50,0,0,3,1,2,50,B," + "12345678901234567890"; Font fFont = new Font("Arial",...
5
by: Valeria Galvano | last post by:
Hi, I'm a newbie in vb.net. I have to send to a printer a file that need to be printed. My problem is that I don't know which kind of document is.. I tried to read the file with a BinaryReader but...
13
by: salad | last post by:
Hi Guys: I was stuck. I needed to send a report to a file. My beautiful report(s) in Access were going to require loss of formatting with RTFs, a PITA in WordMailMerge, sending it as a text...
4
by: Schwarty | last post by:
I hope I posted this to the correct group. If not, please let me know and I will get it posted in the correct section. I have a web application developed in ASP.NET using C# for the code behind....
0
by: Charles Crawford | last post by:
Hi, This apparently is a common problem and I've yet to read a solution that actually works for my specific situation. I have a Zebra RW220 printer that I connect to via Bluetooth connection...
0
by: =?Utf-8?B?Q2hhcmxpZQ==?= | last post by:
Hi, This apparently is a common problem and I've yet to read a solution that actually works for my specific situation. I have a Zebra RW220 printer that I connect to via Bluetooth connection...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.