条码标签打印 - 网络花园 - 最佳实践 - 架构设计 [英] Barcode Label printing-web garden-best practices –architecture design

查看:82
本文介绍了条码标签打印 - 网络花园 - 最佳实践 - 架构设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个打印条形码标签的(asp.net web)应用程序。我基本上有两种方法。环境是负载均衡器环境(完全安全且完全内部环境--Web园区)。假设我们有大约200个标签打印机(配置用于静态ip机器),那些每天必须打印大约100k标签。我正在尝试为标签打印设计一个好的架构,我正在寻找关于良好和最佳方法的建议。

方法1 :(服务器端)

分享所有打印机(网络共享和安装所有服务器上的打印机 - 网络连接),然后当用户点击打印条形码时,我们将跟踪用户请求的客户端IP,我们在db中有一个映射,我们将发送打印响应通过服务器 - 网络共享打印机映射到相应的打印机。

对于这种方法,一次性配置就足够了。



方法2 :(客户端) )

我们将在数据库中进行ip-printer配置。但我们不会共享打印机。当用户点击打印条形码时,我们将生成pdf或图像格式的标签,它将通过Javascript基于ip-printer配置直接打印在客户端,或者这种方法类似于我们在客户端计划的所有内容。

我们的架构建议Approach1很好。但我说的是服务器上的负载会更多,而不是网络共享我建议的那些打印机,留在客户端。在方法2中,我们不会询问客户端应该在哪个打印机上打印标签,因为我们将在ip-printer配置上查找数据库,我的客户端程序将直接在连接的打印机上打印标签到客户端机器。

We have an (asp.net web) application that prints barcode labels. I have basically two approaches. The environment is load balancer environment (completely secure and completely internal environment -Web garden). Let’s say we have around 200 label printers(configured for static ip machines) and those has to print around 100k labels every day. I am trying to design a good architecture for label printing and I am looking for suggestion on the good and best approach.
Approach1: (Server side)
Share all the printers(network sharing and installing the printers at all the servers- network-connect) and after that when user clicks on print barcode we will track the client ip from where the user requested and we have a mapping in db and we will send the print response to the corresponding printer mapped through server-network shared printer.
For this approach one time configuration is enough.

Approach2: (Client Side)
We will do the ip-printer configuration in database. But we won’t be sharing the printer. When user clicks on print barcode we will generate the label in pdf or image format and it will be printed directly at client end based on the ip-printer configuration through Javascript or this approach is something like everything we are planning at client end.
Our architectures have suggested that Approach1 is good. But I am saying that the load will be more on the servers instead of network sharing those printers I suggested them that, leave it at the client end. And in the approach 2 we won’t ask the client on which printer the label should be printed because we will do a db look up on the ip-printer configuration and my client end program will directly print the labels on the printers that are connect to the client machine.

推荐答案

你写的...



我们有大约200个标签打印机(配置为静态ip机器),每天必须打印大约100k标签



怎么样具有如此高打印量的打印性能,并且基于您使用Windows图形打印API(方法I即通过System.Drawing)将打印作业从Web服务器发送到共享客户端打印机这一事实?

恕我直言,我认为无论如何(方法I或II)你应该考虑生成和发送原始打印机命令而不使用Windows Printing API。通过发送原始打印机命令,您将提高打印性能并浪费更少的系统资源。我在一家咨询公司工作,我们在不久前找到了与客户类似的情况。经过大量的研究和测试,结论是我们需要从我们这边生成Zebra命令到目标客户端打印机。我们让一些开发人员在Zebra打印机上拥有一些专业知识,但没有时间在.NET中开发解决方案并在截止日期前完成工作。

因此,我们寻找一些用于生成Zebra命令的即用型解决方案,并找到了SharpZebra(http://sharpzebra.codeplex.com/)开源项目。我们用它进行了一些测试,虽然它工作得很好,但我们得到的堆栈缺少客户要求的标签预览,因为我们只能通过打印来预览标签,这意味着浪费了大量的标签。我们也尝试过Z-bar(http://z-bar.sourceforge.net/),但是它要求你指定我们丢弃的纯Zebra命令,因为其他开发人员在这个问题上没有任何技术诀窍。最后,我们尝试了一个名为ThermalLabel SDK for .NET的付费解决方案,它允许我们在不了解Zebra命令的情况下创建标签,提供了一个可视化设计器,我们将其嵌入到自定义应用程序中,以允许最终用户设计标签并将其上传到我们的数据库用于以后共享,以图像格式预览标签而无需打印标签和废纸,以及用于ASP.NET方案的客户端打印解决方案,因为此SDK主要针对桌面应用程序。唯一的缺点是这个解决方案不是免费的,而且对于ASP.NET场景,每个客户端都需要在本地安装一个小软件实用程序,它需要.NET 3.5(我们有一些非常旧的机器,不得不改变,遗憾的是)

但是,我建议您通过开源项目或付费解决方案生成本机打印机命令,但不要使用Windows打印API来定位此特殊打印机。祝你好运!
You wrote...

"we have around 200 label printers(configured for static ip machines) and those has to print around 100k labels every day"

How is the printing performance with such a high printing volume and based on the fact that you are using Windows graphic printing API (approach-I i.e. through System.Drawing) to send print jobs to the shared client printers from your web server?
IMHO, I think that in any case (approach I or II) you should consider generating and sending raw printer commands and not use Windows Printing API. By sending raw printer commands you will improve printing performance and will waste less system resources. I work for a consulting firm and we've found in a similar situation with a client some time ago. After lot of research and testing, the conclusion was that we needed to generate Zebra commands from our side to target clients printers. We had some developers with some know-how on Zebra printers but not the time to develop a solution in .NET and get things working to the deadline.
So we looked for some ready-to-use solutions for generating Zebra commands and found SharpZebra (http://sharpzebra.codeplex.com/) open-source project. We made some tests with it and although it worked just fine, we got stack with the lack of label preview that was requested by the client as we could only preview labels by printing them which implied wasting lots of labels. We also tried Z-bar (http://z-bar.sourceforge.net/) but it requires you specify pure Zebra commands something that we discarded because other developers did not have any know-how on this matter. Finally, we tried a paid solution called ThermalLabel SDK for .NET which allowed us to create the labels without any knowledge on Zebra commands, provided a visual designer that we embedded into a custom app for allowing end users to design labels and upload them to our DB for later sharing, preview labels in image format without need to print the labels and waste paper, and with a client-side printing solution for ASP.NET scenarios as this SDK targets desktop apps mainly. The only cons is that this solution is not free and that for ASP.NET scenarios, each client needs to install a small software utility locally and it requires .NET 3.5 (we had a couple of very old machines that had to change, sadly)
But again, I'd recommend you to generate native printer commands be it through open-source projects or paid solutions but not go for Windows printing API to target this special printers. Good luck!


经过大量的研究后,我正在最后确定方法 - 对于特别是条形码标签打印机我是好的和可取的。因为Lable Printers相关应用程序应该在打印机上自动打印机标签,不应该询问/中断用户。 Approach1似乎是可行的。如果有人不同意,请与我讨论。
After doing a lot of research I am finalizing the approach-I is good and suggestible for especially bar code label printers. Because Lable Printers related application should printer labels automatically on the printers and should not ask/interrupt users. so Approach1 seems to be feasible. Please discuss with me if any one is not agreeing with it.


这篇关于条码标签打印 - 网络花园 - 最佳实践 - 架构设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆