Dela via


Printer.PrintFileName Property

Gets or sets a value that specifies the file name of an Encapsulated PostScript file and the path to which the file will be saved when the PrintAction property is set to PrintToFile.

Namespace:  Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

Syntax

'Declaration
Public Property PrintFileName As String
    Get
    Set
public string PrintFileName { get; set; }
public:
property String^ PrintFileName {
    String^ get ();
    void set (String^ value);
}
member PrintFileName : string with get, set
function get PrintFileName () : String
function set PrintFileName (value : String)

Property Value

Type: System.String
Returns a String that contains a file path and name.

Remarks

When the PrintAction property is set to PrintToFile, the print output will be saved to an Encapsulated PostScript file (.eps, .ps, or .ai). The PrintFileName property specifies the path and name of the file.

Note

To enable other applications to recognize the file as a PostScript file, you must use a PostScript file extension (.eps, .ps, or .ai) in the PrintFileName property.

If no PrintFileName is specified an exception occurs.

Note

The user is not prompted for a path or a file name extension. To make sure that the file has a valid path and extension, you can implement your own dialog box. To do this, use a SaveFileDialog component and assign the return value to the PrintFileName property before you call the Print method.

Note

Functions and objects in the Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 namespace are provided for use by the tools for upgrading from Visual Basic 6.0 to Visual Basic 2010. In most cases, these functions and objects duplicate functionality that you can find in other namespaces in the .NET Framework. They are necessary only when the Visual Basic 6.0 code model differs significantly from the .NET Framework implementation.

Examples

The following example demonstrates how to display a dialog box to prompt a user for a file name and then assign it to the PrintFileName property.

Dim Printer As New Printer
Dim fileDialog As New Windows.Forms.SaveFileDialog
Dim fileToSave As String
fileDialog.Title = "Save to PostScript file"
fileDialog.AddExtension = True
fileDialog.Filter = "Encapsulated PostScript (*.eps)|"

.NET Framework Security

See Also

Reference

Printer Class

Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 Namespace

Other Resources

Printer Compatibility Library

How to: Fix Upgrade Errors by Using the Printer Compatibility Library (Visual Basic)

Deploying Applications That Reference the Printer Compatibility Library