Zum Hauptinhalt gehen

Suche

Suche

Printer Name Ignored When Using Task Manager

Kommentare

2 Kommentare

  • Avatar
    Legacy Poster

    x

    0
  • Avatar
    Domingo Rodriguez
    Moderator

    The following example shows how to use GetLabelFormatTask to retrieve label format information. If you use this task for showing the Printer Name to be used after you've changed the printer selection for the BT document, does it show the Default printer or the correct one? Do you perhaps just have to save the BarTender document once the changes in the printer selection have been done?

     

    public void Demo()
    {
       // Initialize a new TaskManager object. 
       using (TaskManager btTaskManager = new TaskManager())
       {
          // Start a task engine.
          btTaskManager.Start(1);
    
          // Create a new task to retrieve format information.
          GetLabelFormatTask task = new GetLabelFormatTask(@"C:\Format1.btw");
    
          // Execute the task and wait for completion.
          TaskStatus status = btTaskManager.TaskQueue.QueueTaskAndWait(task, 60000);
    
          if (status == TaskStatus.Success)
          {
             // Get the LabelFormat object from the task // (this is cached format information; not an open document).
             LabelFormat format = task.LabelFormat;
    
             // Display some general information about the label format.
             Console.WriteLine("Label Format Name: '{0}'", format.BaseName);
             Console.WriteLine("Printer Name:      '{0}'", format.PrintSetup.PrinterName);
             Console.WriteLine("Named Substrings:   {0}\n", format.SubStrings.Count);
    
             // Display the names and values of any named substrings in the format. foreach (SubString s in format.SubStrings)
                Console.WriteLine("Substring Name: '{0}' Value: '{1}'", s.Name, s.Value);
          }
    
          // Stop any running task engines.
          btTaskManager.Stop(5000, true);
       }
    }
    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.