Groups | Blog | Home
all groups > dotnet windows forms > february 2008 >

dotnet windows forms : Saving Print Output to Database


HaySeed
2/13/2008 1:28:01 PM
I need to save print output to the database for future retrieval.

I assumed that the best way to do this was to use a BinaryFormatter to
convert my PrintDocument to a byte array - strore the binary stream - then
deserialize it upon recall.

Unfortunately the PrintDocument is not serializable.

Duncan Jones
2/13/2008 10:29:28 PM
You can save the EMF spool file content ( see
http://www.codeproject.com/KB/printing/EMFSpoolViewer.aspx ) or print to PDF
or XPS ..?


[quoted text, click to view]
HaySeed
2/14/2008 3:33:01 PM
Thanks for the response Duncan,

I know I can create an output file which can be streamed into the DB but my
ultimate goal is to reconstitute the PrintDocument class. Is this
possible????

If not, my second choice would be to print it to PDF and stream that file.
I have used a Win2PDF print driver in the past to do create the PDF output
but I'm wondering oif thereis any "ToPDF" functionality built into .Net that
you are aware of ?



L

[quoted text, click to view]
Duncan Jones
2/15/2008 7:01:47 PM
I would suggest maybe printing it to XPS - using the stuff built in to the
latest .NET framework.
An XPS document is just XML and jpegs in a structured document so it should
be fairly easy to divide it and store it in a database?


[quoted text, click to view]
AddThis Social Bookmark Button