跳至主內容

搜尋

搜尋

Web Application Print Samples

評論

5 條評論

  • Avatar
    Ian Cummings
    版主

    You'll find this in the .NET SDK.  Make sure you install the SDK component as part of the BarTender Suite installation.  If you did not do this you'll need to modify your installation.  On my Windows 7 x64 computer the web printing SDK example can be found in the folder: C:\Program Files (x86)\Seagull\BarTender Suite\SDK\Print Server SDK Samples\WebLabelPrint

    0
  • Avatar
    Legacy Poster

    You'll find this in the .NET SDK.  Make sure you install the SDK component as part of the BarTender Suite installation.  If you did not do this you'll need to modify your installation.  On my Windows 7 x64 computer the web printing SDK example can be found in the folder: C:\Program Files (x86)\Seagull\BarTender Suite\SDK\Print Server SDK Samples\WebLabelPrint

     

    Hi,

     

    Thanks for your time to respond, I really apprecite it.

     

    I'm actually using this function to print in a web application (code sample taked from WebLabelPrint):

     

    public void Print()
       {
          try
          {
             TaskManager taskManager = (TaskManager)Application["TaskManager"];
             
             // Make sure the task manager is valid and that engines are running.
             if ((taskManager != null) && (taskManager.TaskEngines.AliveCount != 0))
             {
                LabelFormat labelFormat = CreateLabelFormatFromPageData(_listLabelFormats.SelectedLabelFormatRepositoryFullPath);
                if (labelFormat != null)
                {
                   PrintLabelFormatTask taskPrint = new PrintLabelFormatTask(labelFormat);
                   taskPrint.PrintTimeout = Int32.Parse(ConfigurationManager.AppSettings["PrintTimeout"]);
    
                   if (_listPrinters.LastPrintType == "client")
                   {
                      // Set PrintTimeout to 0 to ensure print job status monitoring does not interfere with client printing
                      taskPrint.PrintTimeout = 0;
                      // Since the client print needs to post-process the print job, sign up for the succeeded event.
                      taskPrint.Succeeded += new EventHandler<TaskEventArgs>(TaskPrint_Succeeded);
                   }
                   taskManager.TaskQueue.QueueTaskAndWait(taskPrint, 60000);
    
                   // Get messages
                   foreach (Message message in taskPrint.Messages)
                   {
                      string formattedMessage = message.Text.Replace("\n", "<br/>");
                      _alert.AddMessage(formattedMessage + "<br/>");
                   }
                }
             }
             else
             {
                ShowMessage("Unable to print. Please make sure you have BarTender installed, activated as <br />Enterprise Print Server edition, and that print engines are running. See the <br />'Manage Print Engines' menu task.");
             }
          }
          catch (Exception ex)
          {
             ShowMessage(ex.Message);
          }
       }
    

    My problem is that this code does not improve the web application performance.

     

    I also have used this code sample for a web application (creating an instance in the load function) with not performance improvement:

     

    private GenericDataAccessLayer.Objects.ComponentSerializationStationConfig _config;
            private Engine engine = null;
            
            
            private string _userId;
            private LabelFormatDocument format;
    
            protected void Page_Load(object sender, EventArgs e)
            {
                try
                {
                    _config = Session["config"] as GenericDataAccessLayer.Objects.ComponentSerializationStationConfig; //this.GetComponentSerializationStationConfig();
    
                    engine = new Engine(true);
    
                    string labelPathAndName = HttpContext.Current.Server.MapPath(_config.LabelFormatAndPath);
    
                    format = engine.Documents.Open(labelPathAndName);
                    format.PrintSetup.PrinterName = _config.LabelPrinterName;
    
                    if (!Page.IsPostBack)
                    {
                    }
                }
            }
    

     

    Please, provide me a simple code sample where I can print labels in a fast way.

     

    Thanks for your time.

    0
  • Avatar
    Legacy Poster

    On my machines, the directory:

     

    C:\Program Files (x86)\Seagull\BarTender Suite\SDK

     

    is empty.  How can I get these files so I can start using the SDK? 

     

    We are using version 9.4

     

     

    Thanks.

    0
  • Avatar
    Domingo Rodriguez
    版主

    kfuller,

     

    You will need to modify the BarTender installation (under "Programs & Features" in Windows) and add the ".NET SDK" component.

    0
  • Avatar
    Domingo Rodriguez
    版主

    Marcosan,

     

    In the Enterprise Automation Edition you can also install and configure our closed web based application product, BarTender Web Print Server (BT-WPS). When you install BT-WPS instead, will you get the same delay issues? Could you quantify this delay? Are you doing Windows printing or Internet printing (internet printing is when the printer is only based at the client side, and the print job will be generated on the server side and send to the client side via the internet's browser ActiveX control / Java applet): http://www.seagullscientific.com/label-software/whitepapers/web-based-barcode-and-label-printing.pdf

     

    Furthermore, the users making use of this web application, will they be on the same LAN / WAN as the server side, or are the client and server sides not connected at all?

    0

登入寫評論。