On Oct 3, 2006, at 5:22 AM, Lennox Jacob wrote:

Hello,

I have this code :

  If g<>Nil then //user didn't cancel Print dialog
    stp=TextField.styledTextPrinter(g,PageWidth-48)
    Do Until stp.EOF
      stp.DrawBlock 36,150,PageHeight-48
      If not stp.EOF then //is there text remaining to print?
        g.NextPage
      End if
    Loop
  End if


which prints every page with a top margin of 150.

I would like to modify it so that only page 1 prints with a top margin of 150 and all subsequent pages print with a margin of 36.

That's an easy one. Use this code:

  Dim Page2 As Boolean

  If g<>Nil then //user didn't cancel Print dialog
    stp=TextField.styledTextPrinter(g,PageWidth-48)
    Do Until stp.EOF
      If Page2 Then
        stp.DrawBlock 36,36,PageHeight-48 // Not First Page
      Else
        stp.DrawBlock 36,150,PageHeight-48 // First Page
        Page2=True // Set flag for the other pages
      End If

      If not stp.EOF then //is there text remaining to print?
        g.NextPage
      End if
    Loop
  End if

Terry

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to