how can i view the .PS file created by PrintAction.PrintToFile?

i try to print a string to a .ps file with the following code:

Dim printer As New Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6.Printer

printer.PrintAction = Drawing.Printing.PrintAction.PrintToFile

printer.PrintFileName = "d:\string.ps"

printer.Print("hello")

printer.EndDoc()

but when i open the .ps file, it's displayed in garbage, isn't it supposed to be some readable script?

how can i print the .ps file to a printer? my printer is a network printer using a non-default port, and i'm using Vista.

[691 byte] By [Mieko] at [2008-1-10]
# 1

well, i map the network printer to lpt1 port, and print the .ps file just now, but the output is still in garbage, Sad

Mieko at 2007-10-3 > top of Msdn Tech,Visual Basic,Visual Basic Power Packs...
# 2

Yes the .ps file should be a postscript file that will be readable however the Printer driver will need to support PostScript.

It sounds like you're current printer driver does not support Postscript.

JohnHart_MSFT at 2007-10-3 > top of Msdn Tech,Visual Basic,Visual Basic Power Packs...
# 3

Hi Mieko,

The .ps is an Encapsulated Postscript image file. You would need to open it in an imaging application (Photoshop, Paint Shop, etc.) that supports the .ps format and print it from there. If you want to print it directly, use PrintAction.PrintToPrinter.

Hope this helps,

Steve Hoag

Microsoft Visual Basic

shoagMSFT at 2007-10-3 > top of Msdn Tech,Visual Basic,Visual Basic Power Packs...