I have my code correctly generating an envelope using a PrintDocument:
Which is fine and dandy, except when it goes to the printer the whole thing (paper size and everything) needs to be rotated 90 degrees.
Right now it's all horizontal from left to right, but printing I need to send it either return address or stamp edge up (the text will need to be rotated 90 degrees so it's vertical too). How do I do that?
Here's how it currently is:
View attachment 2516
I need it to be one of these:
View attachment 2514 or View attachment 2515
VB.NET:
Private Sub EnvelopePrintDocument_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles EnvelopePrintDocument.PrintPage
With e.Graphics
If Not m_OmitReturnAddress Then
Using ReturnFnt As New Font("Arial", 10.0!, FontStyle.Regular)
Dim ReturnName As String = String.Format("{0} {1}", g_Settings.FirstName, g_Settings.LastName).Trim()
Dim RtnNameHeight As Integer = 0I
If ReturnName <> String.Empty Then
.DrawString(ReturnName, ReturnFnt, Brushes.Black, e.MarginBounds.Left, e.MarginBounds.Top)
RtnNameHeight = CInt(.MeasureString(ReturnName, ReturnFnt).Height)
End If
.DrawString(g_Settings.Addresses(m_ReturnAddressIndex).ToString, ReturnFnt, Brushes.Black, e.MarginBounds.Left, e.MarginBounds.Top + RtnNameHeight)
End Using
End If
Using DeliverFnt As New Font("Arial", 12.0!, FontStyle.Regular)
Dim DestAddr As String = String.Format("{0}{1}{2}", CType(CardsListBox.SelectedItem, CardInfo).DisplayName, Environment.NewLine, AddressesMultilineListbox.SelectedItem.ToString)
Dim AddrSize As SizeF = .MeasureString(DestAddr, DeliverFnt)
.DrawString(DestAddr, DeliverFnt, Brushes.Black, CSng(e.MarginBounds.Right / 2.0!) - CSng(AddrSize.Width / 2.0!), CSng(e.MarginBounds.Bottom * (2.0! / 3.0!)) - CSng(AddrSize.Height / 2.0!))
End Using
End With
e.HasMorePages = False
End Sub
Right now it's all horizontal from left to right, but printing I need to send it either return address or stamp edge up (the text will need to be rotated 90 degrees so it's vertical too). How do I do that?
Here's how it currently is:
View attachment 2516
I need it to be one of these:
View attachment 2514 or View attachment 2515