Hello all,
I am trying to find a way to print a document that is stored as a BLOB without having to first open it, the filename is stored as well so I have the extension of the file available. The only idea I have had is to save it in the users temporary folder and then point the PrintDocument class to it but im sure theres a better way of doing it then that.
Thankyou to all who contribute.
views:
38answers:
1
A:
since you have the filename, you could try using ShellExecute to print the file. you would have to save it to a temporary location, though.
I also think it wouldn't be that much different from using PrintDocument, as it also uses the default Print action for the file type. Also, i think you will have to pinvoke it.
maranas
2010-03-05 13:20:40
I was hoping to avoid saving the file to a temp location, this way would get the same results as using PrintDocument but would be harder work surely?
Chiefy
2010-03-05 13:50:03
i think it would be better performance-wise, since you will be pinvoking from win32 api. it will be easier if done from vc++. but convenience-wise it would be better to stick with PrintDocument (especially if you are in C# or VB). i don't think you would have a choice, though, because to print a document you would have to know how to print it:- via it's file type and using default actions, as you are already doing- or by opening the application used to create it
maranas
2010-03-05 13:56:24
Ok thankyou for your help, I guess ill give PrintDocument a go as im in C#.
Chiefy
2010-03-05 14:53:12