LocalPrintServer Class
Assembly: System.Printing (in system.printing.dll)
When your application writes a value to a property of the LocalPrintServer object, that change has no effect until the value is passed to the computer that is represented by the LocalPrintServer object. To ensure that the change in value takes effect, use the Commit method.
In addition, other applications may also change the print service properties of the computer. To ensure that the LocalPrintServer object used by your application has the latest actual values, use the Refresh method.
The following example shows how to create an instance of the LocalPrintServer class.
// -------------------- GetPrintXpsDocumentWriter() ------------------- /// <summary> /// Returns an XpsDocumentWriter for the default print queue.</summary> /// <returns> /// An XpsDocumentWriter for the default print queue.</returns> private XpsDocumentWriter GetPrintXpsDocumentWriter() { // Create a local print server LocalPrintServer ps = new LocalPrintServer(); // Get the default print queue PrintQueue pq = ps.DefaultPrintQueue; // Get an XpsDocumentWriter for the default print queue XpsDocumentWriter xpsdw = PrintQueue.CreateXpsDocumentWriter(pq); return xpsdw; }// end:GetPrintXpsDocumentWriter()
System.Printing.PrintSystemObject
System.Printing.PrintServer
System.Printing.LocalPrintServer
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.