![]() You should never set a PrintTicket property to Unknown. The Unknown value is never used in properties of PrintCapabilities objects. Use the values of this type primarily for these purposes:Īs members of the StaplingCapability collection, which is a property of PrintCapabilities, these values indicate the types of stapling that a printer supports.Īs the value of the Stapling property of a PrintTicket, the value instructs the printer whether, and where, to staple. PrintTicket.Stapling = Stapling.StapleDualLeftĮnd Function ' end:GetPrintTicketFromPrinter() PrintTicket.Duplexing = Duplexing.TwoSidedLongEdge PrintTicket.Collation = Collation.Collated ' No printer exist, return null PrintTicketĭim printTicket As PrintTicket = printQueue.DefaultPrintTicketĭim printCapabilities As PrintCapabilities = printQueue.GetPrintCapabilities() PrintQueue = CType(localPrinterEnumerator.Current, PrintQueue) ' Get PrintQueue from first available printer If localPrinterEnumerator.MoveNext() Then ' Retrieving collection of local printer on user machineĭim localPrinterCollection As PrintQueueCollection = localPrintServer.GetPrintQueues()ĭim localPrinterEnumerator As = localPrinterCollection.GetEnumerator() Private Function GetPrintTicketFromPrinter() As PrintTicketĭim localPrintServer As New LocalPrintServer() ''' A PrintTicket for the current local default printer. ''' Returns a PrintTicket based on the current default printer. ![]() PrintTicket.Stapling = Stapling.StapleDualLeft PrintCapabilities printCapabilities = printQueue.GetPrintCapabilities() PrintTicket printTicket = printQueue.DefaultPrintTicket No printer exist, return null PrintTicket PrintQueue = (PrintQueue)localPrinterEnumerator.Current PrintQueueCollection localPrinterCollection = LocalPrintServer localPrintServer = new LocalPrintServer() Private PrintTicket GetPrintTicketFromPrinter() PrintTicket->Stapling = Stapling::StapleDualLeft If (printCapabilities->StaplingCapability->Contains(Stapling::StapleDualLeft)) PrintTicket->Duplexing = Duplexing::TwoSidedLongEdge If (printCapabilities->DuplexingCapability->Contains(Duplexing::TwoSidedLongEdge)) PrintTicket->Collation = Collation::Collated If (printCapabilities->CollationCapability->Contains(Collation::Collated)) PrintCapabilities^ printCapabilities = printQueue->GetPrintCapabilities() PrintTicket^ printTicket = printQueue->DefaultPrintTicket PrintQueue = ((PrintQueue^)localPrinterEnumerator->Current) Get PrintQueue from first available printer System::Collections::IEnumerator^ localPrinterEnumerator = localPrinterCollection->GetEnumerator() PrintQueueCollection^ localPrinterCollection = localPrintServer->GetPrintQueues() Retrieving collection of local printer on user machine LocalPrintServer^ localPrintServer = gcnew LocalPrintServer() PrintTicket^ GetPrintTicketFromPrinter () / A PrintTicket for the current local default printer. / Returns a PrintTicket based on the current default printer. The following example shows how to test a printer's capabilities and configure the print job to take advantage of them. The feature (whose options are represented by this enumeration) is set to an option not defined in the Print Schema. Also called saddle-stitch stapling.Ī single staple in the lower-left corner.Ī single staple in the lower-right corner.Ī single staple in the upper-left corner.Ī single staple in the upper-right corner.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |