跳至主內容

搜尋

搜尋

Generating Label Using .net

評論

5 條評論

  • Avatar
    Domingo Rodriguez
    版主

    Modifying named sub-strings currently requires you to follow exactly the steps you've followed if the data on the label needs to change for every label that prints. If you want to send variable data for several labels in one go, you will need to connect your BT document to a text database file (you would create and fill before):

     

    Imports Seagull.BarTender.Print.Database

    ' Application Code

    ' ...

    Dim btEngine As New Engine()

    ' Start a BarTender print engine

    btEngine.Start()

    ' Open a label format

    Dim btFormat As LabelFormatDocument = btEngine.Documents.Open("c:\MyLabel.btw")

    ' Set the TextFile database connection file name

    CType(btFormat.DatabaseConnections("TextFileDB"), TextFile).FileName = "c:\NutritionInformationEurope.txt"

    ' Print the label format document

    btFormat.Print()

    ' Stop the engine

    btEngine.Stop()
     

    Creating a text file with the variable data to be printed is not part of our .NET SDKs, this is part of standard VB .NET IO Dlls. 

    0
  • Avatar
    Legacy Poster

    Thank you that helped. I want to clarify some things.

     

    most of the time we have one format and data is changing.

     

    1) That means between engine start and end, I can do that without loop , speicify label format and data using file instead of loop.

      Printing to printer, although requires printers to be active. Otherwise throws an error.

     

    2) Using file, does that require developer to include bartender command in the beginning of the file, like commander program? Or just pure data file like following? and do all the other setting using code as

    --set label path Dim btFormat As LabelFormatDocument = btEngine.Documents.Open("c:\MyLabel.btw")

    -->set printer

     

    File:

     "Name1", "Address1", "ZipCod1e", "ProductCode1", "Product Description1"

     "Name2", "Address2", "ZipCode2", "ProductCode2", "Product Description2"

     "Name3", "Address3", "ZipCode3", "ProductCode3", "Product Description3"

     

    Would this still communicate to printer directly or this can generates the file for commander application?

     

    3) if I am using commander app

     create a file and drop it using .net IO. and hardcode the command line in the beginning of the file. Drop the file where bartender is monitoring to pick up? Do I have to hardcode the command line in the beginning? or there is a way to create that command using code?

     

    Thanks

    Dipti

     

     

     

    Thanks

    Dipti

    0
  • Avatar
    Domingo Rodriguez
    版主

    1. Yes, between engine start and end you can have BarTender read from a text file. It will generate one print job being sent to the printer. This is the same as if you would connect your BarTender document to a database file via BarTender's "File > Database Connection Setup" dialog.

     

    2. It just requires you to format it as pure data (you might wish to use a database header with the names of the database fields). Basically, at print time you've to use the same data format as you're using at design time for connecting your BT document to the "sample database" (this is required). The structure of the sample database and the one you use at print time has to be the same.

     

    3. Commander can recognize several types of trigger files:

     

    • Trigger files with just data on it --> In which case you would use a "BarTender" command in Commander.
    • Trigger files with a Commander Script header and footer --> In which case you would use a "Commander Script" command in the Commander task.
    • Trigger files in XML format --> In which case you would use "BTXML Script" (and sometimes also the "Transform" command) in the Commander task

     

    I suggest you to take a look at Commander's White Papers as well:

     

    Commander:

    http://www.bartenderbarcodesoftware.com/label-software/whitepapers/Codeless-Integration-of-Barcode-and-Label-Printing-with-other-Software(English).pdf

     

    Commander Examples:

    http://www.bartenderbarcodesoftware.com/label-software/whitepapers/Commander-Examples(English).pdf

    0
  • Avatar
    Legacy Poster

    Hi got it. Thanks.

     

    With .net label printing, reading textfile and printing multiple labels, would using task queue makes it better that program doesn't have to wait for it to finish printing from printer?

     

    How does the task queue and starting multiple engine works parallel? submitting task is still sequential so how does multiple engine works with queued tasks.

     

    Thanks

    Dipti

    0
  • Avatar
    Domingo Rodriguez
    版主

    You've two methods for sending tasks to the TaskQueue:

     

    TaskQueue.QueueTask --> This method is asynchronous and won't wait for the task to finish.

    TaskQueue.QueueTaskandWait --> This method is synchronous and will wait for the task to finish until processing the next one.

     

    In your case, please note that the print job which corresponds to all records of your database is just one task. If you plan to simultaneously print several BT documents which read from different database text files, then yes, running multiple engines will result in a benefit. If you would e.g. make use of TaskQueue.QueueTask() method, the task will be submitted to the Task Queue and immediately after (without waiting for the task to finish), another task will be submitted to the queue. Print job order won't be guaranteed 

     

    I advice you to take a look at BarTender's Help as our .NET SDK documentation is very complete and helpful on this. Just open BarTender, press the F1 key and visit the "Automating BarTender > Automation with the BarTender .NET SDKs > BarTender .NET Print Server SDK > Getting Started" topic.

    0

登入寫評論。