Click here to Skip to main content
15,890,947 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
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.
Posted
Updated 23-Oct-13 10:13am
v2
Comments
Sergey Alexandrovich Kryukov 22-Oct-13 23:13pm    
Your "track the client ip from where the user requested" sounds absurd to me. IPs are very often dynamic. Same user can work with different IPs, different users can work on the same IP.

What is "PDF or any other font"?! :-)

Now, " we won’t ask the client on which printer the label should be printed". What, is there the possibility when the user needs to say "on which printer"? Why? Or do you mean type of the printer: media, color or not, etc.? Other than that is not a user's concern...

—SA
mohan5k 23-Oct-13 16:17pm    
Hello sergey,
IP - we are using static IPs.(no dynamic IPs). It doesnt matter which ip the client is using. The printers mapped to the ip will be stored int he Database.

"PDF or any other font"?! :-)? pdf or image ( I updated the question)

3rd question: suppose I have configured a printer to machine having ip address(11.11.11.11) and the printer name is "Printer-One" these details will be available in the database and I will do a lookup and through javascript will print the labels directly at the client side. I hope I have answered you questions.Please let me know if this post need to be modified or to be improved more technically with more examples.
Sergey Alexandrovich Kryukov 23-Oct-13 17:06pm    
You first version of the text really made me thinking bad things. :-) Thank you for clarifications. As soon as you don't care who is the user, it looks fine.

I still don't see the answer on my third question. "We won’t ask the client on which printer the label should be printed" looks perfectly reasonable. But from context it looked like in first approach, the client is still asked to choose one. Is it so? If it is, choose from what? If this is a type of printer (not model, type, like "color laser" or something like that), it would make sense. If "printer #..." or "printer at IP...", or even printer "HP Model... #3", it would look crazy. What was the idea when the printer is to be chosen (if there was such idea at all)?
—SA
mohan5k 24-Oct-13 11:06am    
Thanks for your patience and clarifications!!
Third Question:
"We won’t ask the client on which printer the label should be printed" looks perfectly reasonable. But from context it looked like in first approach"
Actually in the First approach the label will be printed through the server(We need to share the printer through network - and install the printer in the server).
But in the second approach it is not network shared and will be printed directly on the server.

I hope we are diverting from the topic.
Topic summary: Do we really need to share all the printers and then print the labels directly from the Server or give it to the browser and to the client. Which one would be the fastest/easiest/safest approach.
Sergey Alexandrovich Kryukov 24-Oct-13 11:20am    
From what I understand right now, not sharing printers looks way more reasonable. At the same time, there many difference aspects I just cannot overview at once... All the possible or required scenarios should be considered in finer detail, both from the black-box and white-box perspectives...
—SA

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!
 
Share this answer
 
Comments
mohan5k 27-Oct-13 11:04am    
Thanks Marc,
I will go through your solution on How to integrate the same in ASP.NET. You are right!! Our solution has to print very high volume of labels in a day. Actually our client don't even have time to see the sample label(in image or some-thing),just it has to print on the label. Now regarding the performance. We are using a very high level system configuration we are using a powerful NLB(load balancer) with 10 high end configuration servers. Till now we have not done any PLT(Performance and Load testing on printers-- because simulation of this is taking time for us). But in the mean time I will go through your suggestions and will be ready with a sample application and during PLT the above approach isn't working then I will use your approach and will post my findings.
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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900