I needed a way to be able to generate labels from a database using ASP, and have those labels print directly from the browser.
My first attempt worked for about 60% of my clients, the bad ones attributed to printer differences. We were all using the same browser. side note: does the screen resolution have an effect on <br> tags?
So I investigated DHTML with absolute positioning. The client gets to choose which fields to include on the label, which type face, which size, and color per line. There is also a DB filter and a drop down box of options to order the labels. For now I'm using the standard mailing labels Avery 5160 and clones.
Through a combination of JS arrays I was able to capture the incoming Form variables and set the color, size, and positioning through CSS.
I had to calculate the page breaks as well since the requirement was one click to the print icon to print all labels.
The beauty of it is that the HTML portion of the code is only about 10 lines. The rest is ASP related.
We deploy today, and it tested OK on several sites. Let's hope for 100%.....