Send Printer Graphics Object to file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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...
 
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.
 
Actually, if your users buy and install Adobe Acrobat, they can redirect any
printout to a PDF file.
 
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.
 
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....
 
Back
Top