Creating a custom job description

To create a job description and override either the number of copies, the range of pages, or both:

  1. Create the client part of the print job description.
        TGenericClientJobDescription* clientPart = new TGenericClientJobDescription;
  2. Set the number of copies.
        clientPart->SetCopies(numberOfCopies);  // number of copies
  3. Specify a page range.
        clientPart->SetPageRange(TStandardPageRange(2,5)); // pages 2 through 5
  4. Add the client job component to a printer job component created by a printer.
    Usually the system passes you a printer when you make a request or when the end user specifies a print operation by dragging a document onto a printer. You can also resurrect one you've kept with the folio or flattened in some data dictionary somewhere; you cannot create one from scratch.
    Currently, you must construct the printer before you can use it. Future releases of the system will provide TPrinter objects. To instantiate a
    printer, use:
        TPrinterprinter(kSystemPrinter);   // This is temporary only
    This creates a printer object representative of the system default printer. To get a job description, just ask the printer to create one for you.
          // combine both client and printer job descriptions
          TPrintJobDescription
          jobDescription(printer.CreateJobDescription(),clientPart);
    The TPrintJobDescription object adopts both job description components so the client has no more dealings with either of them.
  5. Use the print job to print a job.
        myPageFolio.Print(jobDescription);

[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker