Zum Hauptinhalt gehen

Suche

Suche

Hide Message "printing... Please Wait"

Kommentare

2 Kommentare

  • Avatar
    Ian Cummings
    Moderator

    Instead of running a batch file, why don't you develop your service to use BarTender's automation interface?  Note that this requires the Automation edition or above.

     

    http://www.bartenderbarcodesoftware.com/label-software/whitepapers/Controlling-Barcode-Label-Software-using-C-Sharp-and-VB.NET(English).pdf

     

    Public Sub Demo()
       ' Initialize & start a new BarTender print engine. 
       using btEngine As New Engine(True)
          ' Open a format.
          btEngine.Documents.Open("C:\Format1.btw")
    
          ' Declare a commandline and execute it ' (this command line will print all open formats). 
          Dim commandLine As String = "/P"
          btEngine.CommandLine(commandLine)
    
          ' Since the commandline is processed asynchronously, we must ' wait for printing to complete before stopping the engine. 
          Do While btEngine.IsProcessingCommandLines OrElse btEngine.IsPrinting
             System.Threading.Thread.Sleep(500)
          Loop 
    
          ' Stop the BarTender print engine.
          btEngine.Stop(SaveOptions.SaveChanges)
       End Using 
    End Sub
    
    0
  • Avatar
    Legacy Poster

    Hi,

     

    first, thank you very much for the quick response, let me explain how it is currently operating.

     

    Content of file .csv

    first row -> printer;label;status;spec_name;article_id;unit_id;customer_po;short_name;code_product_fefco;grade;width_ord;diam_ord;s_wgt_scaled;s_length_lineal;unwind;mill_id;Barcode1;Barcode2;Order_id;Line_Item;Consignee_id

    second row ->

    MD1W1;STANDARD;G;INTERPAC  105;INT105X2250X1400X100;3010000002;inicio opti;STOCK;50;105;225;140;2502;10700;<<<<;MD1;30100000022712;501052250250210700;D000002;2;99999071
     

    the concatencion of the first two columns of the csv. determining the printer. MD1W1+STANDARD

     

     

    Content of files.txt

    3020072977_1368281901.csv
    3030052193_1368281948.csv
    3030052193_1368282066.csv

    relationship of files containing information to transfer the labels to print

     

     

    each file labelMD1W1.btbat, labelMD1W2.btbat, labelMA1W1.btbat, labelMD1RW1.btbat is designed for a four different printer

     

    @echo on
    setlocal enabledelayedexpansion
    cd  D:\labels\label

    :begin
    del /Q D:\labels\label\label.csv
    del /Q D:\labels\label\files.txt
    dir /B D:\labels\print_label\*.csv >D:\labels\label\files.txt
    for /f "eol=# tokens=*" %%a in (D:\labels\label\files.txt) do (
        if not %%a.==. (
            copy /Y D:\labels\print_label\%%a D:\labels\label\label.csv
            for /f "eol=# skip=1 tokens=1,2 delims=; " %%f in (D:\labels\label\label.csv) do (
                If Not "%%f"=="" (                
                    If "%%f%%g"=="MD1W1STANDARD" CALL D:\labels\label\labelMD1W1.btbat
                    If "%%f%%g"=="MD1W2STANDARD" CALL D:\labels\label\labelMD1W2.btbat
                    If "%%f%%g"=="MA1W1STANDARD" CALL D:\labels\label\labelMA1W1.btbat
                    If "%%f%%g"=="MD1RW1STANDARD" CALL D:\labels\label\labelMD1RW1.btbat
                    move /Y D:\labels\print_label\%%a D:\labels\printed_label
                    TIMEOUT /T 10
                ) ELSE (
                    TIMEOUT /T 10
                    goto begin
                )
            )
        )
    )

    endlocal
    TIMEOUT /T 10
    goto begin

     

     

    everything works fine in the current batch, showing the popup mentioned, "Printing... Please wait", the problem is that if someone closes the session, it stops working.

    For that reason, I tried to launch the batch, from scheduled tasks, without errors, but does not work.

    Also with the compiler "Quick batch compiler", I made ​​the batch executable .exe. From the cmd (command line of windows), the executable works correctly and displays the popup mentioned
    "Printing... Please wait".

    But now,
    the executable launched from the scheduled tasks, or from the service, does not produce errors, but does not work, for this, I think it all fails if from the scheduled tasks, or services, because you can not display the popup.

    Thank you very much, best regards.

    0

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