473,395 Members | 1,915 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,395 software developers and data experts.

Send Printer Graphics Object to file

Our win forms application generates printed output that is built dynamically
from images and data queries then written to a graphics object for printing,
however I also need to be able to save the final graphics object to some sort
of file that can be saved to disk, then emailed to users outside of our
domain.

Is it possible to stream the graphics output to a generic filetype(word,
pdf, html)?

Thanks in advance for any assistance.
Jul 21 '05 #1
5 1304
There is no easy way to do what you want to do, that I know of, that is
built into .NET. Depending on the frequency that you do this, you
could use a free tool, like PDFCreator (
http://sourceforge.net/projects/pdfcreator/ ). PDFCreator is a printer
driver that you install, then when you print to it, it converts the
print stream into a PDF document. It works very well, but I think you
would have to do it manually. Of course, it is Open Source, so if you
are ambitious enough, I am sure you could turn it into a DLL and figure
out how to automate it :)

Know it's not exactly what you asked for, but might help...

Jul 21 '05 #2
What I would do is grab the graphics device context for the printer, and
save each page as a .JPG or something.

I know this isn't ideal.

The alternative is to build your printout in a RichTextBox and save the RTF
to a file which can be opened with Word.

"ipswich67" <ip*******@discussions.microsoft.com> wrote in message
news:A7**********************************@microsof t.com...
Our win forms application generates printed output that is built
dynamically
from images and data queries then written to a graphics object for
printing,
however I also need to be able to save the final graphics object to some
sort
of file that can be saved to disk, then emailed to users outside of our
domain.

Is it possible to stream the graphics output to a generic filetype(word,
pdf, html)?

Thanks in advance for any assistance.

Jul 21 '05 #3
Actually, if your users buy and install Adobe Acrobat, they can redirect any
printout to a PDF file.
Jul 21 '05 #4
Or they can use free software... Maybe each user doesn't want to pay
$300 for the standard version of Acrobat when PDFCreator does the same
for zero cost.

Jul 21 '05 #5
Thanks for the replies. I thought that it seemed improbable and had
considered both alternatives, but was hoping for a more direct approach to be
available in .net that I was unaware of Thanks for confirming my
suspicions....

"ipswich67" wrote:
Our win forms application generates printed output that is built dynamically
from images and data queries then written to a graphics object for printing,
however I also need to be able to save the final graphics object to some sort
of file that can be saved to disk, then emailed to users outside of our
domain.

Is it possible to stream the graphics output to a generic filetype(word,
pdf, html)?

Thanks in advance for any assistance.

Jul 21 '05 #6

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

Similar topics

5
by: Tom Berry | last post by:
We currently are trying our first transformation from VB6 to VB.Net. Of course, the Printer object is gone, but I'm having trouble finding the replacement syntax necessary to perform similar...
1
by: Ravikanth[MVP] | last post by:
Hello, You can use the PrintDocument component to use the default printer. If you don't specify a printer to the PrintDocument object, by default, it will use the default printer. This is a...
4
by: Rob T | last post by:
I have a small VB program that has a printing module...very simple....and works great. However, If I try to print to a generic printer, I get the following error: "The data area passed to a...
5
by: ipswich67 | last post by:
Our win forms application generates printed output that is built dynamically from images and data queries then written to a graphics object for printing, however I also need to be able to save the...
0
by: hamil | last post by:
I have a graphic file demo program that almost works. My form has a PageSetupDialog, PrintPreview, PrintDialog, and a PrintDocument control. Sample code follows. Now here is the quesion. When I...
4
by: Gregory Gadow | last post by:
I've cobbled together a PrinterClass that takes a text file and dumps it to a printer. The app using is has multiple threads, all of which need access to a shared instance. Can someone point me to...
1
by: Chris Dunaway | last post by:
When using PrintDocument to print something, if I check the PageBounds property of the PrintPageEventArgs object, it shows the rectangle to be 850 x 1100, or 100 dpi. But when I check the value of...
1
by: remya1000 | last post by:
how to send a .txt file to a printer. after creating a .txt file i need to send that .txt file to a printer.using vb.net and while sending that file to printer i need to tell, which printer i need...
0
by: dtnam | last post by:
Hi, I want to do something like that: void doc_PrintPage(object sender, PrintPageEventArgs e) { // draw a rectangle e.Graphics.DrawRectangle(Pens.Black, new Rectangle(10, 10, 100,...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.