Saving the PrinterSetup Settings

Hi Byron,
I faced the problem this way:

// Saving the Printer Settings

Dim f As FolderItem
Dim strOut As TextOutputStream
Dim ps As New PrinterSetup

f = GetFolderItem("")

f = f.Child("PrinterSettings.txt")
' If the text file does not exist create it!
If f <> Nil Then
  If ps.PageSetupDialog = True Then
    Dim g As Graphics
    g = OpenPrinterDialog(ps, Nil)
    If g <> Nil Then
      strOut = TextOutputStream.Create(f)
      ' strOut.Write(EncodeBase64(ps.SetupString))
      strOut.Write(ps.SetupString)
      
      strOut.Close
      Return True
      Exit Function
    End If
  End If
End If

Then, before printing, I read the printer settings:

ReadSetupString(SettingsFile As String) As String
  // Reading the Printer settings from the text file

  Dim f As FolderItem
  Dim SetupString As String
  Dim strIn As TextInputStream

  f = GetFolderItem("")

  f = f.Child(SettingsFile)

  If f <> Nil Then
    If f.Exists Then
      strIn = TextInputStream.Open(f)
      ' SetupString = DecodeBase64(strIn.ReadAll)
      SetupString = strIn.ReadAll
      strIn.Close
      Return SetupString
      Exit Function
    End If
  End If
End Function

And finally, when I print the report:

Dim ps As New PrinterSetup

// loading the Printer settoings
Dim SetupString As String
SetupString = ReadSetupString("PrinterSettings.txt")      
ps.SetupString = SetupString

Hope this helps you!