Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Synopsis:

I have successfully gotten a .txt file from my site and displayed in a text box. Now i need to print that .txt file in my default printer.

 

 

Code:

Dim printFont As System.Drawing.Font

Dim sr As System.IO.StreamReader

Dim wc As New System.Net.WebClient

 

 

Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage

 

 

readmeh = New System.IO.StreamReader(wc.OpenRead ("http://mysite/text.txt"))

printFont = New System.Drawing.Font("Arial", 10)

e.Graphics.DrawString(SR, printFont, Brushes.Maroon, 1, 1)

 

 

End Sub

 

Question:

Everything is ok except it seems only strings can be printed this way with e.graphics etc.. anyway of storing that streamreader to a string? :cool:

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...