Print to a File
-
Hey got a question, I'm using a printe document in my program, My printing goes just fine, along with my print preview. My question, is does anybody know how to at runtime, choose to print to a file, like you were to select that on a print dialog? Setting the path and file to create for this Print to File, I've searched all over and, can't seem to find anything on this, also tried a few different things. I want to do this all without user involvment. Thanks in advance
-
Hey got a question, I'm using a printe document in my program, My printing goes just fine, along with my print preview. My question, is does anybody know how to at runtime, choose to print to a file, like you were to select that on a print dialog? Setting the path and file to create for this Print to File, I've searched all over and, can't seem to find anything on this, also tried a few different things. I want to do this all without user involvment. Thanks in advance
At runtime, you could just write the information to a text file using the normal File methods. You really can't setup a printer to use a FILE: port at runtime. There is no support in the .NET BCL to do this. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
At runtime, you could just write the information to a text file using the normal File methods. You really can't setup a printer to use a FILE: port at runtime. There is no support in the .NET BCL to do this. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
Thanks Dave for the reply, figured you would. But, let me be more clear, as to why I'm trying to do this, maybe you can give me a better solution. At work, when we click the fax button in are program, the MIS department, has that program print the document to a file ( one that is not text and also not a tiff file ) then passing this file to an email that gets sent to are biscom fax server. I'm assuming what they do, is act like printing, but print to a file (sort of like on the option on the print dialog to print to a file instead) and pass this along in the email. If not, I'll have to figure out how to create a tiff file from my print document to make this work. Thanks for your help
-
Thanks Dave for the reply, figured you would. But, let me be more clear, as to why I'm trying to do this, maybe you can give me a better solution. At work, when we click the fax button in are program, the MIS department, has that program print the document to a file ( one that is not text and also not a tiff file ) then passing this file to an email that gets sent to are biscom fax server. I'm assuming what they do, is act like printing, but print to a file (sort of like on the option on the print dialog to print to a file instead) and pass this along in the email. If not, I'll have to figure out how to create a tiff file from my print document to make this work. Thanks for your help
The printing classes in the .NET BCL currently do not support (correctly anyway...) turning on the "Print To File" option through code. It only allows you to activate the check box on the PrintDialog. Even then, it doesn't work properly and your output will still go to the printer and not a file. This MIGHT be fixed in SP1 for .NET 1.1 and SP3 for .NET 1.0. You best bet is to "print" your document, I should say "draw" your document, to a Bitmap object and save that as a .JPG, .BMP, or whatever you need and send that image as an attachment in an email. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
The printing classes in the .NET BCL currently do not support (correctly anyway...) turning on the "Print To File" option through code. It only allows you to activate the check box on the PrintDialog. Even then, it doesn't work properly and your output will still go to the printer and not a file. This MIGHT be fixed in SP1 for .NET 1.1 and SP3 for .NET 1.0. You best bet is to "print" your document, I should say "draw" your document, to a Bitmap object and save that as a .JPG, .BMP, or whatever you need and send that image as an attachment in an email. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
I figured after not finding anything on printing to a file, as I was wanting to do. Thanks for your help, and suggestions.