Search EggHeadCafe's Job Board
EggHeadCafe Silverlight WPF ASP.NET VB.NET C# Excel SQL Server SharePoint
search
MicrosoftArticlesForumsFAQs
C# .NET
VB.NET
Visual Studio .NET
ADO.NET
Xml / Xslt
VB 6.0
.NET CF
GDI+
LINQ
Deployment
Security
FoxPro
Silverlight / WPF
Entity Framework
RIA Services

WebArticlesForumsFAQs
JavaScript
ASP
ASP.NET
WCF

DatabasesArticlesForumsFAQs
SQL Server
Access
Oracle
MySQL
Other Databases

OfficeArticlesForumsFAQs
Excel
Word
Powerpoint
Outlook
Publisher
Money

Non-MicrosoftArticlesForumsFAQs
NHibernate
Perl
PHP
Ruby
Java
Linux / Unix
Apple
Open Source

Operating SysArticlesForumsFAQs
Windows 7
Windows Server
Windows Vista
Windows XP
Windows Update
MAC
Linux / UNIX

Server PlatformsArticlesForumsFAQs
BizTalk
Site Server
Exhange Server
IIS

Graphic DesignArticlesForumsFAQs
Macromedia Flash
Adobe PhotoShop
Expression Blend
Expression Design
Expression Web

OtherArticlesForumsFAQs
Lounge
Subversion / CVS
Ask Dr. Dotnetsky
Active Directory
Networking
Uninstall Virus
Job Openings
Product Reviews
Search Engines
Resumes

 

  View Other Visual Studio .NET Posts   Ask New Question  Ask New Question With Power Editor

printing of document using stream capture dll file
kapil tandon posted at Thursday, November 20, 2008 7:17 AM


Private Sub PrintToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintToolStripMenuItem.Click

Try

Dim streamToPrint As StreamReader

Dim printFont As Font

Dim screencapturer As New ScreenshotCapture.ScreenCapture

Dim randomGenerator As New System.Random(2000)

Dim filePath As String = Application.StartupPath + "\tempScreenShoot" + randomGenerator.Next().ToString + ".jpg"

screencapturer.CaptureWindowToFile(Me.Handle, filePath, System.Drawing.Imaging.ImageFormat.Jpeg)

streamToPrint = New StreamReader(filePath)

printFont = New Font("Arial", 10)

Dim pd As New Printing.PrintDocument

Dim myDialog As New PrintDialog

myDialog.Document = pd

If myDialog.ShowDialog() = DialogResult.OK Then

pd.PrinterSettings = myDialog.PrinterSettings

pd.Print()

End If

Dim fileToBeDeleted As New System.IO.FileInfo(filePath)

fileToBeDeleted.Delete()

Catch ex As Exception

ExceptionManager.Publish(ex)

End Try

End Sub

 

this id the code i created for ptinting.it is creating jpg file and then finally printing.i am not able to figure out why it is printing the blank page.

can anybody tell me what is the problem in the code?

n hw can i achieve this task

Reply    Reply Using Power Editor
  Rank Winnings Points
November 0 $0.00 0
October 0 $0.00 0