By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,326 Members | 838 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,326 IT Pros & Developers. It's quick & easy.

Print preview prints blank page

P: n/a
The print preview dialog will display the preview of the document but will
print a blank page when the print icon is clicked. Printing is fine
otherwise. Can i set the print icon in the printpreviewdialog to go to the
printdialog.
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Chase,
The print button just calls Print again on the PrintDocument. You need
to manage your datastream for the printing calls such that this resets the
data stream position to the start of your data. Providing an override for
OnBeginPrint is the standard way to do this.

Ron Allen
"Chase" <Ch***@discussions.microsoft.com> wrote in message
news:25**********************************@microsof t.com...
The print preview dialog will display the preview of the document but will
print a blank page when the print icon is clicked. Printing is fine
otherwise. Can i set the print icon in the printpreviewdialog to go to
the
printdialog.

Nov 21 '05 #2

P: n/a
* "=?Utf-8?B?Q2hhc2U=?=" <Ch***@discussions.microsoft.com> scripsit:
The print preview dialog will display the preview of the document but will
print a blank page when the print icon is clicked. Printing is fine
otherwise. Can i set the print icon in the printpreviewdialog to go to the
printdialog.


<URL:http://dotnet.mvps.org/dotnet/samples/printing/downloads/PrintingDemo.zip>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #3

P: n/a
Chase,
Since you are using a StreamReader you can just close it and reopen it.
Or just pass in the name of the text file and always open the stream in
OnBeginPrint and close it in OnEndPrint where you can also clean up
allocated fonts that you use.
Allocate/open things in OnBeginPrint and clean up everything in
OnEndPrint and you should have a document that doesn't leak any resources
and where the Print method can be called without a problem.

Ron Allen
"Chase" <Ch***@discussions.microsoft.com> wrote in message
news:5E**********************************@microsof t.com...
Ok i have the override set up. I am using a streamreader to read a text
document, how do i reset the reader to the begining ofthefile.

Thank you,
Chase

"Ron Allen" wrote:
Chase,
The print button just calls Print again on the PrintDocument. You
need
to manage your datastream for the printing calls such that this resets
the
data stream position to the start of your data. Providing an override
for
OnBeginPrint is the standard way to do this.

Ron Allen
"Chase" <Ch***@discussions.microsoft.com> wrote in message
news:25**********************************@microsof t.com...
> The print preview dialog will display the preview of the document but
> will
> print a blank page when the print icon is clicked. Printing is fine
> otherwise. Can i set the print icon in the printpreviewdialog to go to
> the
> printdialog.


Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.