Zum Hauptinhalt gehen

Suche

Suche

Configuring Bartender As A Web Service Using Print Server Sdk

Kommentare

4 Kommentare

  • Avatar
    Ian Cummings
    Moderator

    Don't kill a BarTender process for each print request, instead keep them alive and reuse for subsequent print jobs.  This is what the PrintServer SDK does, and it also allows you to scale up the number of processes running in parallel to thus print multiple print jobs in parallel.  Take a look at the Web Print Server SDK example to see how it's done.

    0
  • Avatar
    Legacy Poster

    Thank you for the response.

     

    Were you referring to the Print Server SDK and the WebLabelPrint example?

     

    I am trying to convert some of my old code into a format compatible with the print server SDK.

     

    What I used to have was: 

     

    Dim myformat As LabelFormatDocument
    Dim myEngine As New Engine()
    
    myEngine.Start()
    myformat = myEngine.Documents.Open(sPrintFileLocation)
    myformat.PrintSetup.PrinterName = sPrinterName
    myformat.PrintSetup.IdenticalCopiesOfLabel = nNumberofLabels
    
    'set data
    For i As Integer = 0 To aData.GetUpperBound(0)
      myformat.SubStrings(i).Value = aData(i)
    Next
    
    Dim myMessages As Messages
    Dim waitForCompletionTimeout As Integer = 10000
    Dim myResult As Result = myformat.Print("Barcode Printing", waitForCompletionTimeout, myMessages)
    

    What I am doing here is configuring the label I would like to print and the location I would like to to print too before I actually do the printing. Can you provide assistance in helping me get there?

    0
  • Avatar
    Domingo Rodriguez
    Moderator

    BarTender's Help (F1 key within BarTender) has plenty of information on how to perform task based printing using the Print Server SDK and on how to manage print load. I suggest you to take a look at the "Automating BarTender > Automation with the BarTender .NET SDK > BarTender .NET Print Server SDK > Getting Started topic".

     

    Yes the Web Label Print Sample source code can be found under "C:\Program Files (x86)\Seagull\BarTender Suite\SDK\Print Server SDK Samples\WebLabelPrint".

    0
  • Avatar
    Gene Henson

    Just to give you a high level understanding of the Print Server SDK, there are a few concepts that you should understand:

    • Print Engine(s) - this is the BarTender process, or processes, that will do that actual printing
    • Task - this is something you want to do, which is most often a print job
    • Task Queue - this is our logic that sits between the two

    You'll end up creating "tasks" that contain the configured print job information (similar to what you're doing above, setting the printer, label format, copies, etc.), and then you'll submit that task to the task queue.  Any available print engines will go to the task queue and consume the submitted tasks.

     

    This is much more efficient for high frequency printing because, as Ian mentioned above, you can spin up multiple print engines that sit and wait for available work.  All you have to do is create and submit your tasks, and everything is handled by the SDK.  You can even write some logic to start more engines during peak printing, etc.

     

    As Domingo said, the BarTender SDK help has a wealth of information on this topic including code samples.

    0

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