Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Print without user intervention

Posted on 2006-07-19
5
Medium Priority
?
226 Views
Last Modified: 2010-04-16
We have an application that creates log files throughout the day.  I need to print the contents of each log file as soon as its created.  I have written a program that uses a FileSystemWatcher to catch the file, and I can read the contents, but how do I print to a printer without any user intervention?  The report is very simple, basicaly I am just listing out six(6) text fields - I don't need graphics, or font control, just need to print the text.
0
Comment
Question by:MGothelf
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17141426
Printing within C# is not as simple operation as it could, but it can be accomplished with a PrintDocument instance.

Bob
0
 

Author Comment

by:MGothelf
ID: 17141836
What is a printDocument, and how do I use it???
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17141988
Here read this article, and if it doesn't help or doesn't make sense, let me know.

Master Everyday Printing in .NET
http://www.ftponline.com/vsm/2002_11/magazine/features/eaton/

Bob
0
 

Author Comment

by:MGothelf
ID: 17147051
Thanks, that did the trick.  I will award the points but maybe you can answer a related question.  The text file in question is a fax transmission log.  The fax is also stored as a TIFF file.  The user now would like to print a mini copy of the first page of the TIFF file.  Any ideas how to do that?
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 2000 total points
ID: 17151043
1) Load the TIFF from the file with the Image class:

   Image img = Image.FromFile(fileName);

2) Draw the image on the PrintDocument, in the PrintPage event handler, using the Graphics object

   e.Graphics.DrawImage(img, 100, 100);

Bob
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

598 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question