473,326 Members | 2,110 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,326 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 1299
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.