S
Slonocode
First a background on what I'm trying to achieve. I'm writing a small
utitily that will paste the contents of the clipboard(a mailing address)
into a textbox. Then the contents of the textbox will be sent to the
printer and printed on a label. The label is 4" high by 5.625" wide and
tractor fed in bulk. The printer is dot matrix and physically connected to
another machine but shared and set as default on the machine running the
utility.
ABOUT THE PRINTDOCUMENT OBJECT:
When instantiating where does it get its defaultpagesettings and
printersettings? I am assuming from the printer properties of the actual
machine?
I created a new form in the server properties on the machine for the label.
Here is my printdocument code
Private Sub pd_PrintPage(ByVal sender As System.Object, ByVal e As
System.Drawing.Printing.PrintPageEventArgs)
Dim fnt As Font = Me.txtAddress.Font
Dim brush As New SolidBrush(Color.Black)
Dim s As String = Me.txtAddress.Text
Dim x As Single = e.MarginBounds.Left
Dim y As Single = e.MarginBounds.Top
e.Graphics.DrawString(s, fnt, brush, x, y)
e.HasMorePages = False
End Sub
ABOUT THE PRINTPREVIEWDIALOG OBJECT:
I can't seem to get the print preview to accurately reflect the label. It
always shows a letter sized preview and the text is too small to read.
Which leads me to believe that my actual print document is probably letter
sized since it just draws the printdocument. Although the form feed on the
printer works correctly for the label. So needless to say I'm somewhat
confused.
Here is the printpreview code
Private Sub btnPrintPreview_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnPrintPreview.Click
Dim ppdlg As PrintPreviewDialog = New PrintPreviewDialog()
With ppdlg
..Document = pd
..WindowState = FormWindowState.Normal
..ShowDialog(Me)
End With
End Sub
Thanks for any assistance
--Sloncode
utitily that will paste the contents of the clipboard(a mailing address)
into a textbox. Then the contents of the textbox will be sent to the
printer and printed on a label. The label is 4" high by 5.625" wide and
tractor fed in bulk. The printer is dot matrix and physically connected to
another machine but shared and set as default on the machine running the
utility.
ABOUT THE PRINTDOCUMENT OBJECT:
When instantiating where does it get its defaultpagesettings and
printersettings? I am assuming from the printer properties of the actual
machine?
I created a new form in the server properties on the machine for the label.
Here is my printdocument code
Private Sub pd_PrintPage(ByVal sender As System.Object, ByVal e As
System.Drawing.Printing.PrintPageEventArgs)
Dim fnt As Font = Me.txtAddress.Font
Dim brush As New SolidBrush(Color.Black)
Dim s As String = Me.txtAddress.Text
Dim x As Single = e.MarginBounds.Left
Dim y As Single = e.MarginBounds.Top
e.Graphics.DrawString(s, fnt, brush, x, y)
e.HasMorePages = False
End Sub
ABOUT THE PRINTPREVIEWDIALOG OBJECT:
I can't seem to get the print preview to accurately reflect the label. It
always shows a letter sized preview and the text is too small to read.
Which leads me to believe that my actual print document is probably letter
sized since it just draws the printdocument. Although the form feed on the
printer works correctly for the label. So needless to say I'm somewhat
confused.
Here is the printpreview code
Private Sub btnPrintPreview_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnPrintPreview.Click
Dim ppdlg As PrintPreviewDialog = New PrintPreviewDialog()
With ppdlg
..Document = pd
..WindowState = FormWindowState.Normal
..ShowDialog(Me)
End With
End Sub
Thanks for any assistance
--Sloncode