|
-
Oct 23rd, 2003, 12:08 PM
#1
Thread Starter
Addicted Member
Print: How to automatically define the orientation to landscape? (RESOLVED)
e.PageSettings.Landscape = True and PrinterDocument1.DefaultPageSettings.Landscape = True didn't work for me.
How to automatically define the orientation to landscape?
Thanks.
Last edited by AlvaroF1; Oct 23rd, 2003 at 08:51 PM.
-
Oct 23rd, 2003, 03:58 PM
#2
Lively Member
I thought for sure I posted a reply to this yesterday. Anyhow, don't set printer orientation in the PrintPage event (which is what you seem to be doing), set it before the PrintDocument.Print event is called:
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpref/html/frlrfSystemDrawingPrintingPageSettingsClassLandscapeTopic.htm
VB Code:
Public Sub Printing()
Try
streamToPrint = New StreamReader(filePath)
Try
printFont = New Font("Arial", 10)
Dim pd As New PrintDocument()
AddHandler pd.PrintPage, AddressOf pd_PrintPage
pd.PrinterSettings.PrinterName = printer
' Set the page orientation to landscape.
[b] pd.DefaultPageSettings.Landscape = True
pd.Print()[/b]
Finally
streamToPrint.Close()
End Try
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
This tested OK for me.
-
Oct 23rd, 2003, 08:50 PM
#3
Thread Starter
Addicted Member
Oh, you are right!
Thanks!
-
Oct 23rd, 2003, 10:06 PM
#4
Lively Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|