Try this...

Code:
Private Declare Function Escape Lib "gdi32" _
        (ByVal hdc As IntPtr, ByVal nEscape As Integer, ByVal nCount As Integer, _
         ByVal lpInData As String, ByVal lpOutData As Object) As Integer

Private Const PASSTHROUGH As Integer = 19

Dim pd As New Printing.PrintDocument

Private Sub Cleanit()
    Dim tmp As String
    tmp = Chr(27) & "some cleaning string"
    Dim hDC As IntPtr = pd.PrinterSettings.CreateMeasurementGraphics.GetHdc
    Escape(hDC, PASSTHROUGH, Len(tmp), tmp, 0)
    pd.PrinterSettings.CreateMeasurementGraphics.ReleaseHdc(hDC)
End Sub