HP PCL Banner creation and printing on a server<p align=left><font face=Arial size=2></font> </p> <p align=left><font face=Arial size=2>The following code is used to create a banner page that is pre-pended to a PCL print-stream<br>and then binary copied to a network printer. The concept is that since the PCL creation is<br>performed on a server, the banner page needs to be created and printed immediately before<br>the document so that the requestor is identified with the banner page.</p> <p align=left> </p> <p align=left>I am just getting my feet wet with .Net and in the process of moving some of my VB6<br>code into .Net.</p> <p align=left> </p> <p align=left>1. CreateBannerPS - This routine works fine, but it uses the Scripting.FileSystemObject. I am <br>    trying to replace this functionality without using the Scripting.FileSystemObject. This is the<br>    method I used in VB6.<br>2. CreateBannerPSNew is my attempt to replace this functionality. It works except an additional<br>    page containing some symbols is printed prior to the banner page.</p> <p align=left> </p> <p align=left><u>Questions<br></u>1. What needs to be done to prevent the page with the symbols?<br>2. Is there a better method for embedding the escape characters?</p> <p align=left> </p> <p align=left>Appreciate all comments<br>Tim</p> <p align=left><br>Option Strict On<br>Option Explicit On</p> <p align=left> </p> <p align=left>Module Banner</p> <p align=left>  Sub Main()<br>    Dim OUTPUT_DIR As String = My.Application.Info.DirectoryPath<br>    Dim FName As String = &quot;Test.pcl&quot;<br>    Dim sUser As String = &quot;TBS2&quot;<br>    Dim sPrinter As String = &quot;HP78&quot;<br>    'Debug.Print(&quot;Old Method: &quot; &amp; Banner.CreateBannerPS(Path:=OUTPUT_DIR, _<br>    '  FName:=&quot;Old.pcl&quot;, UserId:=sUser, sPrinter:=sPrinter))<br>    'Debug.Print(&quot;New Method: &quot; &amp; Banner.CreateBannerPSNew(Path:=OUTPUT_DIR, _<br>    '  FName:=&quot;New.pcl&quot;, UserId:=sUser, sPrinter:=sPrinter))<br>    'Exit Sub<br>    If Banner.CreateBannerPSNew(Path:=OUTPUT_DIR, FName:=FName, _<br>        UserId:=sUser, sPrinter:=sPrinter) Then<br>      Debug.Print(&quot;Ok&quot;)<br>      BinaryPrint(FName:=OUTPUT_DIR &amp; &quot;\&quot; &amp; FName, _<br>        sPrinter:=&quot;z_&quot; &amp; sPrinter &amp; &quot;$&quot;)<br>    Else<br>      Debug.Print(&quot;Error&quot;)<br>    End If<br>    If Banner.CreateBannerPS(Path:=OUTPUT_DIR, FName:=FName, _<br>        UserId:=sUser, sPrinter:=sPrinter) Then<br>      Debug.Print(&quot;Ok&quot;)<br>      BinaryPrint(FName:=OUTPUT_DIR &amp; &quot;\&quot; &amp; FName, _<br>        sPrinter:=&quot;z_&quot; &amp; sPrinter &amp; &quot;$&quot;)<br>    Else<br>      Debug.Print(&quot;Error&quot;)<br>    End If<br>  End Sub</p> <p align=left> </p> <p align=left>  'Creates Banner Sheet Print-Stream file<br>  Function CreateBannerPSNew(ByVal Path As String, ByVal FName As String, _<br>    ByVal UserId As String, ByVal sPrinter As String) As Boolean<br>    Dim Txt As String = &quot;&quot;<br>    CreateBannerPSNew = False<br>    Txt = &quot;&#27;%-12345X@PJL ENTER LANGUAGE=PCL&quot; &amp; vbCrLf 'Enter PCL language<br>    Txt += &quot;&#27;E&quot; &amp; vbCrLf 'Printer Reset<br>    Txt += &quot;&#27;*t600R&quot; &amp; vbCrLf 'Resolution - 600 DPI<br>    Txt += &quot;&#27;&amp;u600D&quot; &amp; vbCrLf 'Unit-of-Measure - units per inch<br>    Txt += &quot;&#27;*r0F&quot; &amp; vbCrLf 'Presentation<br>    Txt += &quot;&#27;&amp;l0o1E&quot; &amp; vbCrLf 'Top Margin<br>    Txt += &quot;&#27;&amp;l0S&quot; &amp; vbCrLf 'Simplex/Duplex<br>    Txt += &quot;&#27;&amp;l7H&quot; &amp; vbCrLf 'Paper Source<br>    Txt += &quot;&#27;&amp;l2a8c1E&quot; &amp; vbCrLf 'Top Margin<br>    Txt += &quot;&#27;*p0x0Y&quot; &amp; vbCrLf 'Units of Measure<br>    Txt += &quot;&#27;*c0t5760x7704Y&quot; &amp; vbCrLf '???<br>    Txt += &quot;&#27;&amp;l1X&quot; &amp; vbCrLf 'Number of copies<br>    Txt += &quot;&#27;*b0M&quot; &amp; vbCrLf 'Compression mode<br>    'Font Id, Typeface, Stroke weight, style, pitch, spacing<br>    Txt += &quot;&#27;(19U&#27;(s4099t0b0s10h0P&quot; &amp; vbCrLf<br>    Txt += &quot;&#27;&amp;d@&quot; &amp; vbCrLf 'Underline disable<br>    Txt += &quot;&#27;*v0o0T&quot; &amp; vbCrLf 'transparency mode, current pattern<br>    Txt += &quot;&#27;*p415Y  &#27;*p330X===================================&quot; &amp; _<br>      &quot;=========================&quot; &amp; vbCrLf<br>    Txt += &quot;&#27;(19U&quot; 'Symbol set - Windows ANSI<br>    Txt += &quot;&#27;(s4099T&quot; 'Typeface - Courier (Scalable)<br>    Txt += &quot;&#27;(s-4B&quot; 'Stroke Weight: -4 Extra Light - Does not seem to work<br>    Txt += &quot;&#27;(s0S&quot; 'Style: 0-Upright, 1-Italic, 32-Outline - Does not seem to work<br>    Txt += &quot;&#27;(s0.75H&quot; 'Pitch - characters per inch<br>    Txt += &quot;&#27;(s0P&quot; 'Spacing - 0 for fixed, 1 for proportional<br>    Txt += &quot;&#27;*p1600Y  &#27;*p600X&quot; &amp; UserId &amp; vbCrLf<br>    Txt += &quot;&#27;(19U&#27;(s4099t0b0s10h0P&#27;&amp;d@&quot; &amp; vbCrLf<br>    Txt += &quot;&#27;*p2200Y  &#27;*p330XPrint Server:&#27;*p1225X&quot; &amp; _<br>      Replace(Replace(Replace(sPrinter, &quot;z_&quot;, &quot;&quot;), &quot;$&quot;, &quot;&quot;), &quot;\\&quot;, &quot;&quot;) &amp; vbCrLf<br>    Txt += &quot;&#27;*p2300Y  &#27;*p330XDate Printed:&#27;*p1225X&quot; &amp; _<br>      Format(Now, &quot;MM/dd/yyyy&quot;) &amp; vbCrLf<br>    Txt += &quot;&#27;*p2400Y  &#27;*p330XTime Printed:&#27;*p1225X&quot; &amp; _<br>      Format(Now, &quot;hh:mms tt&quot;) &amp; vbCrLf<br>    Txt += &quot;&#27;*p2600Y &#27;*p330X===================================&quot; &amp; _<br>      &quot;=========================&quot; &amp; vbCrLf</p> <p align=left>    '    Txt += &quot;&#27;E&quot; &amp; vbCrLf 'Printer Reset</p> <p align=left>    My.Computer.FileSystem.WriteAllText(Path &amp; &quot;\&quot; &amp; FName, Txt, False, _<br>      System.Text.Encoding.UTF8)<br>    If Err.Number = 0 Then CreateBannerPSNew = True<br>  End Function</p> <p align=left> </p> <p align=left>  'Creates Banner Sheet Print-Stream file<br>  Function CreateBannerPS(ByVal Path As String, ByVal FName As String, _<br>    ByVal UserId As String, ByVal sPrinter As String) As Boolean<br>    Dim fso As New Scripting.FileSystemObject<br>    Dim ts As Scripting.TextStream<br>    CreateBannerPS = False<br>    ts = fso.CreateTextFile(Path &amp; &quot;\&quot; &amp; FName, True) 'Overwrites existing file<br>    ts.WriteLine(&quot;&#27;%-12345X@PJL ENTER LANGUAGE=PCL&quot;) 'Enter PCL language<br>    ts.WriteLine(&quot;&#27;E&quot;) 'Printer Reset<br>    ts.WriteLine(&quot;&#27;*t600R&quot;) 'Resolution - 600 DPI<br>    ts.WriteLine(&quot;&#27;&amp;u600D&quot;) 'Unit-of-Measure - units per inch<br>    ts.WriteLine(&quot;&#27;*r0F&quot;) 'Presentation<br>    ts.WriteLine(&quot;&#27;&amp;l0o1E&quot;) 'Top Margin<br>    ts.WriteLine(&quot;&#27;&amp;l0S&quot;) 'Simplex/Duplex<br>    ts.WriteLine(&quot;&#27;&amp;l7H&quot;) 'Paper Source<br>    ts.WriteLine(&quot;&#27;&amp;l2a8c1E&quot;) 'Top Margin<br>    ts.WriteLine(&quot;&#27;*p0x0Y&quot;) 'Units of Measure<br>    ts.WriteLine(&quot;&#27;*c0t5760x7704Y&quot;) '???<br>    ts.WriteLine(&quot;&#27;&amp;l1X&quot;) 'Number of copies<br>    ts.WriteLine(&quot;&#27;*b0M&quot;) 'Compression mode<br>    'Font Id, Typeface, Stroke weight, style, pitch, spacing<br>    ts.WriteLine(&quot;&#27;(19U&#27;(s4099t0b0s10h0P&quot;)<br>    ts.WriteLine(&quot;&#27;&amp;d@&quot;) 'Underline disable<br>    ts.WriteLine(&quot;&#27;*v0o0T&quot;) 'transparency mode, current pattern<br>    ts.WriteLine(&quot;&#27;*p415Y  &#27;*p330X===================================&quot; &amp; _<br>      &quot;=========================&quot;)<br>    ts.Write(&quot;&#27;(19U&quot;) 'Symbol set - Windows ANSI<br>    ts.Write(&quot;&#27;(s4099T&quot;) 'Typeface - Courier (Scalable)<br>    ts.Write(&quot;&#27;(s-4B&quot;) 'Stroke Weight: -4 Extra Light - Does not seem to work<br>    ts.Write(&quot;&#27;(s0S&quot;) 'Style: 0-Upright, 1-Italic, 32-Outline - Does not seem to work<br>    ts.Write(&quot;&#27;(s0.75H&quot;) 'Pitch - characters per inch<br>    ts.Write(&quot;&#27;(s0P&quot;) 'Spacing - 0 for fixed, 1 for proportional<br>    ts.WriteLine(&quot;&#27;*p1600Y  &#27;*p600X&quot; &amp; UserId)<br>    ts.WriteLine(&quot;&#27;(19U&#27;(s4099t0b0s10h0P&#27;&amp;d@&quot;)<br>    ts.WriteLine(&quot;&#27;*p2200Y  &#27;*p330XPrint Server:&#27;*p1225X&quot; &amp; _<br>      Replace(Replace(Replace(sPrinter, &quot;z_&quot;, &quot;&quot;), &quot;$&quot;, &quot;&quot;), &quot;\\&quot;, &quot;&quot;))<br>    ts.WriteLine(&quot;&#27;*p2300Y  &#27;*p330XDate Printed:&#27;*p1225X&quot; &amp; _<br>      Format(Now, &quot;MM/dd/yyyy&quot;))<br>    ts.WriteLine(&quot;&#27;*p2400Y  &#27;*p330XTime Printed:&#27;*p1225X&quot; &amp; _<br>      Format(Now, &quot;hh:mms tt&quot;))<br>    ts.WriteLine(&quot;&#27;*p2600Y &#27;*p330X===================================&quot; &amp; _<br>      &quot;=========================&quot;)<br>    ts.Close()<br>    ts = Nothing<br>    fso = Nothing<br>    If Err.Number = 0 Then CreateBannerPS = True<br>  End Function</p> <p align=left> </p> <p align=left>  Sub BinaryPrint(ByVal FName As String, ByVal sPrinter As String)<br>    Dim p As Process = New Process<br>    Dim i As Integer = 0<br>    Dim sArg As String = &quot;/C Copy /b &quot;&quot;&quot; &amp; FName &amp; &quot;&quot;&quot; <a title="file://\\Dcpp100\">\\Dcpp100\</a>&quot; &amp; sPrinter<br>    Debug.Print(sArg)<br>    With p.StartInfo<br>      .FileName = &quot;cmd.exe&quot;<br>      .Arguments = sArg<br>      .UseShellExecute = False<br>      .CreateNoWindow = True<br>    End With<br>    p.Start()<br>    While Not p.HasExited<br>      Debug.Print(&quot;BinaryPrint CloseWindow &quot; &amp; CStr(i))<br>      i += 1<br>      System.Threading.Thread.Sleep(1000)     'Sleep for 1 second<br>      If i &gt;= 10 Then<br>        Debug.Print(&quot;BinaryPrint kill process required&quot;)<br>        p.Kill()<br>        Exit While<br>      End If<br>    End While<br>    p.Dispose()<br>  End Sub</p> <p align=left> </p> <p align=left>End Module</p></font>© 2009 Microsoft Corporation. All rights reserved.Thu, 19 Jun 2008 00:15:52 Zfacd6440-b4b6-4f5d-ae0c-689fb0ce4c15http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/facd6440-b4b6-4f5d-ae0c-689fb0ce4c15#facd6440-b4b6-4f5d-ae0c-689fb0ce4c15http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/facd6440-b4b6-4f5d-ae0c-689fb0ce4c15#facd6440-b4b6-4f5d-ae0c-689fb0ce4c15Tim_Shafhttp://social.msdn.microsoft.com/Profile/en-US/?user=Tim_ShafHP PCL Banner creation and printing on a server<p align=left><font face=Arial size=2></font> </p> <p align=left><font face=Arial size=2>The following code is used to create a banner page that is pre-pended to a PCL print-stream<br>and then binary copied to a network printer. The concept is that since the PCL creation is<br>performed on a server, the banner page needs to be created and printed immediately before<br>the document so that the requestor is identified with the banner page.</p> <p align=left> </p> <p align=left>I am just getting my feet wet with .Net and in the process of moving some of my VB6<br>code into .Net.</p> <p align=left> </p> <p align=left>1. CreateBannerPS - This routine works fine, but it uses the Scripting.FileSystemObject. I am <br>    trying to replace this functionality without using the Scripting.FileSystemObject. This is the<br>    method I used in VB6.<br>2. CreateBannerPSNew is my attempt to replace this functionality. It works except an additional<br>    page containing some symbols is printed prior to the banner page.</p> <p align=left> </p> <p align=left><u>Questions<br></u>1. What needs to be done to prevent the page with the symbols?<br>2. Is there a better method for embedding the escape characters?</p> <p align=left> </p> <p align=left>Appreciate all comments<br>Tim</p> <p align=left><br>Option Strict On<br>Option Explicit On</p> <p align=left> </p> <p align=left>Module Banner</p> <p align=left>  Sub Main()<br>    Dim OUTPUT_DIR As String = My.Application.Info.DirectoryPath<br>    Dim FName As String = &quot;Test.pcl&quot;<br>    Dim sUser As String = &quot;TBS2&quot;<br>    Dim sPrinter As String = &quot;HP78&quot;<br>    'Debug.Print(&quot;Old Method: &quot; &amp; Banner.CreateBannerPS(Path:=OUTPUT_DIR, _<br>    '  FName:=&quot;Old.pcl&quot;, UserId:=sUser, sPrinter:=sPrinter))<br>    'Debug.Print(&quot;New Method: &quot; &amp; Banner.CreateBannerPSNew(Path:=OUTPUT_DIR, _<br>    '  FName:=&quot;New.pcl&quot;, UserId:=sUser, sPrinter:=sPrinter))<br>    'Exit Sub<br>    If Banner.CreateBannerPSNew(Path:=OUTPUT_DIR, FName:=FName, _<br>        UserId:=sUser, sPrinter:=sPrinter) Then<br>      Debug.Print(&quot;Ok&quot;)<br>      BinaryPrint(FName:=OUTPUT_DIR &amp; &quot;\&quot; &amp; FName, _<br>        sPrinter:=&quot;z_&quot; &amp; sPrinter &amp; &quot;$&quot;)<br>    Else<br>      Debug.Print(&quot;Error&quot;)<br>    End If<br>    If Banner.CreateBannerPS(Path:=OUTPUT_DIR, FName:=FName, _<br>        UserId:=sUser, sPrinter:=sPrinter) Then<br>      Debug.Print(&quot;Ok&quot;)<br>      BinaryPrint(FName:=OUTPUT_DIR &amp; &quot;\&quot; &amp; FName, _<br>        sPrinter:=&quot;z_&quot; &amp; sPrinter &amp; &quot;$&quot;)<br>    Else<br>      Debug.Print(&quot;Error&quot;)<br>    End If<br>  End Sub</p> <p align=left> </p> <p align=left>  'Creates Banner Sheet Print-Stream file<br>  Function CreateBannerPSNew(ByVal Path As String, ByVal FName As String, _<br>    ByVal UserId As String, ByVal sPrinter As String) As Boolean<br>    Dim Txt As String = &quot;&quot;<br>    CreateBannerPSNew = False<br>    Txt = &quot;&#27;%-12345X@PJL ENTER LANGUAGE=PCL&quot; &amp; vbCrLf 'Enter PCL language<br>    Txt += &quot;&#27;E&quot; &amp; vbCrLf 'Printer Reset<br>    Txt += &quot;&#27;*t600R&quot; &amp; vbCrLf 'Resolution - 600 DPI<br>    Txt += &quot;&#27;&amp;u600D&quot; &amp; vbCrLf 'Unit-of-Measure - units per inch<br>    Txt += &quot;&#27;*r0F&quot; &amp; vbCrLf 'Presentation<br>    Txt += &quot;&#27;&amp;l0o1E&quot; &amp; vbCrLf 'Top Margin<br>    Txt += &quot;&#27;&amp;l0S&quot; &amp; vbCrLf 'Simplex/Duplex<br>    Txt += &quot;&#27;&amp;l7H&quot; &amp; vbCrLf 'Paper Source<br>    Txt += &quot;&#27;&amp;l2a8c1E&quot; &amp; vbCrLf 'Top Margin<br>    Txt += &quot;&#27;*p0x0Y&quot; &amp; vbCrLf 'Units of Measure<br>    Txt += &quot;&#27;*c0t5760x7704Y&quot; &amp; vbCrLf '???<br>    Txt += &quot;&#27;&amp;l1X&quot; &amp; vbCrLf 'Number of copies<br>    Txt += &quot;&#27;*b0M&quot; &amp; vbCrLf 'Compression mode<br>    'Font Id, Typeface, Stroke weight, style, pitch, spacing<br>    Txt += &quot;&#27;(19U&#27;(s4099t0b0s10h0P&quot; &amp; vbCrLf<br>    Txt += &quot;&#27;&amp;d@&quot; &amp; vbCrLf 'Underline disable<br>    Txt += &quot;&#27;*v0o0T&quot; &amp; vbCrLf 'transparency mode, current pattern<br>    Txt += &quot;&#27;*p415Y  &#27;*p330X===================================&quot; &amp; _<br>      &quot;=========================&quot; &amp; vbCrLf<br>    Txt += &quot;&#27;(19U&quot; 'Symbol set - Windows ANSI<br>    Txt += &quot;&#27;(s4099T&quot; 'Typeface - Courier (Scalable)<br>    Txt += &quot;&#27;(s-4B&quot; 'Stroke Weight: -4 Extra Light - Does not seem to work<br>    Txt += &quot;&#27;(s0S&quot; 'Style: 0-Upright, 1-Italic, 32-Outline - Does not seem to work<br>    Txt += &quot;&#27;(s0.75H&quot; 'Pitch - characters per inch<br>    Txt += &quot;&#27;(s0P&quot; 'Spacing - 0 for fixed, 1 for proportional<br>    Txt += &quot;&#27;*p1600Y  &#27;*p600X&quot; &amp; UserId &amp; vbCrLf<br>    Txt += &quot;&#27;(19U&#27;(s4099t0b0s10h0P&#27;&amp;d@&quot; &amp; vbCrLf<br>    Txt += &quot;&#27;*p2200Y  &#27;*p330XPrint Server:&#27;*p1225X&quot; &amp; _<br>      Replace(Replace(Replace(sPrinter, &quot;z_&quot;, &quot;&quot;), &quot;$&quot;, &quot;&quot;), &quot;\\&quot;, &quot;&quot;) &amp; vbCrLf<br>    Txt += &quot;&#27;*p2300Y  &#27;*p330XDate Printed:&#27;*p1225X&quot; &amp; _<br>      Format(Now, &quot;MM/dd/yyyy&quot;) &amp; vbCrLf<br>    Txt += &quot;&#27;*p2400Y  &#27;*p330XTime Printed:&#27;*p1225X&quot; &amp; _<br>      Format(Now, &quot;hh:mms tt&quot;) &amp; vbCrLf<br>    Txt += &quot;&#27;*p2600Y &#27;*p330X===================================&quot; &amp; _<br>      &quot;=========================&quot; &amp; vbCrLf</p> <p align=left>    '    Txt += &quot;&#27;E&quot; &amp; vbCrLf 'Printer Reset</p> <p align=left>    My.Computer.FileSystem.WriteAllText(Path &amp; &quot;\&quot; &amp; FName, Txt, False, _<br>      System.Text.Encoding.UTF8)<br>    If Err.Number = 0 Then CreateBannerPSNew = True<br>  End Function</p> <p align=left> </p> <p align=left>  'Creates Banner Sheet Print-Stream file<br>  Function CreateBannerPS(ByVal Path As String, ByVal FName As String, _<br>    ByVal UserId As String, ByVal sPrinter As String) As Boolean<br>    Dim fso As New Scripting.FileSystemObject<br>    Dim ts As Scripting.TextStream<br>    CreateBannerPS = False<br>    ts = fso.CreateTextFile(Path &amp; &quot;\&quot; &amp; FName, True) 'Overwrites existing file<br>    ts.WriteLine(&quot;&#27;%-12345X@PJL ENTER LANGUAGE=PCL&quot;) 'Enter PCL language<br>    ts.WriteLine(&quot;&#27;E&quot;) 'Printer Reset<br>    ts.WriteLine(&quot;&#27;*t600R&quot;) 'Resolution - 600 DPI<br>    ts.WriteLine(&quot;&#27;&amp;u600D&quot;) 'Unit-of-Measure - units per inch<br>    ts.WriteLine(&quot;&#27;*r0F&quot;) 'Presentation<br>    ts.WriteLine(&quot;&#27;&amp;l0o1E&quot;) 'Top Margin<br>    ts.WriteLine(&quot;&#27;&amp;l0S&quot;) 'Simplex/Duplex<br>    ts.WriteLine(&quot;&#27;&amp;l7H&quot;) 'Paper Source<br>    ts.WriteLine(&quot;&#27;&amp;l2a8c1E&quot;) 'Top Margin<br>    ts.WriteLine(&quot;&#27;*p0x0Y&quot;) 'Units of Measure<br>    ts.WriteLine(&quot;&#27;*c0t5760x7704Y&quot;) '???<br>    ts.WriteLine(&quot;&#27;&amp;l1X&quot;) 'Number of copies<br>    ts.WriteLine(&quot;&#27;*b0M&quot;) 'Compression mode<br>    'Font Id, Typeface, Stroke weight, style, pitch, spacing<br>    ts.WriteLine(&quot;&#27;(19U&#27;(s4099t0b0s10h0P&quot;)<br>    ts.WriteLine(&quot;&#27;&amp;d@&quot;) 'Underline disable<br>    ts.WriteLine(&quot;&#27;*v0o0T&quot;) 'transparency mode, current pattern<br>    ts.WriteLine(&quot;&#27;*p415Y  &#27;*p330X===================================&quot; &amp; _<br>      &quot;=========================&quot;)<br>    ts.Write(&quot;&#27;(19U&quot;) 'Symbol set - Windows ANSI<br>    ts.Write(&quot;&#27;(s4099T&quot;) 'Typeface - Courier (Scalable)<br>    ts.Write(&quot;&#27;(s-4B&quot;) 'Stroke Weight: -4 Extra Light - Does not seem to work<br>    ts.Write(&quot;&#27;(s0S&quot;) 'Style: 0-Upright, 1-Italic, 32-Outline - Does not seem to work<br>    ts.Write(&quot;&#27;(s0.75H&quot;) 'Pitch - characters per inch<br>    ts.Write(&quot;&#27;(s0P&quot;) 'Spacing - 0 for fixed, 1 for proportional<br>    ts.WriteLine(&quot;&#27;*p1600Y  &#27;*p600X&quot; &amp; UserId)<br>    ts.WriteLine(&quot;&#27;(19U&#27;(s4099t0b0s10h0P&#27;&amp;d@&quot;)<br>    ts.WriteLine(&quot;&#27;*p2200Y  &#27;*p330XPrint Server:&#27;*p1225X&quot; &amp; _<br>      Replace(Replace(Replace(sPrinter, &quot;z_&quot;, &quot;&quot;), &quot;$&quot;, &quot;&quot;), &quot;\\&quot;, &quot;&quot;))<br>    ts.WriteLine(&quot;&#27;*p2300Y  &#27;*p330XDate Printed:&#27;*p1225X&quot; &amp; _<br>      Format(Now, &quot;MM/dd/yyyy&quot;))<br>    ts.WriteLine(&quot;&#27;*p2400Y  &#27;*p330XTime Printed:&#27;*p1225X&quot; &amp; _<br>      Format(Now, &quot;hh:mms tt&quot;))<br>    ts.WriteLine(&quot;&#27;*p2600Y &#27;*p330X===================================&quot; &amp; _<br>      &quot;=========================&quot;)<br>    ts.Close()<br>    ts = Nothing<br>    fso = Nothing<br>    If Err.Number = 0 Then CreateBannerPS = True<br>  End Function</p> <p align=left> </p> <p align=left>  Sub BinaryPrint(ByVal FName As String, ByVal sPrinter As String)<br>    Dim p As Process = New Process<br>    Dim i As Integer = 0<br>    Dim sArg As String = &quot;/C Copy /b &quot;&quot;&quot; &amp; FName &amp; &quot;&quot;&quot; <a title="file://\\Dcpp100\">\\Dcpp100\</a>&quot; &amp; sPrinter<br>    Debug.Print(sArg)<br>    With p.StartInfo<br>      .FileName = &quot;cmd.exe&quot;<br>      .Arguments = sArg<br>      .UseShellExecute = False<br>      .CreateNoWindow = True<br>    End With<br>    p.Start()<br>    While Not p.HasExited<br>      Debug.Print(&quot;BinaryPrint CloseWindow &quot; &amp; CStr(i))<br>      i += 1<br>      System.Threading.Thread.Sleep(1000)     'Sleep for 1 second<br>      If i &gt;= 10 Then<br>        Debug.Print(&quot;BinaryPrint kill process required&quot;)<br>        p.Kill()<br>        Exit While<br>      End If<br>    End While<br>    p.Dispose()<br>  End Sub</p> <p align=left> </p> <p align=left>End Module</p></font>Thu, 03 Jan 2008 20:37:52 Z2008-02-12T16:10:58Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/facd6440-b4b6-4f5d-ae0c-689fb0ce4c15#71d7d9e8-ca79-46f9-881f-0e90eeb245fahttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/facd6440-b4b6-4f5d-ae0c-689fb0ce4c15#71d7d9e8-ca79-46f9-881f-0e90eeb245faTim_Shafhttp://social.msdn.microsoft.com/Profile/en-US/?user=Tim_ShafHP PCL Banner creation and printing on a server<p align=left><font face=Arial size=2>I discovered that if I use &quot;System.IO.File.WriteAllText&quot; to replace &quot;My.Computer.FileSystem.WriteAllText&quot; the </font></p> <p align=left><font face=Arial size=2>additional page and symbols are not printed.</p></font>Tue, 12 Feb 2008 16:10:39 Z2008-02-12T16:10:58Z