Take the 2-minute tour ×

I want to design a webapp that can print signs for various products, such as a big store. The content of the signs (product names , descriptions ,prices ) comes from the server and changes daily. Each product can be printed to a A3 or A4 document. It is also possible to have 3 signs in one A4 page. In addition each product type has a differently desinged sign (Tv's have the price on the top of the page in RED, and printers have the price on bottom left in BOLD)

the idea is that the program will get the product data from the DB, push it in inside a html template according to the page size and product type and print the html (or convert the html to pdf and print)

some problems I faced so far: - textfields from the DB can be to long, and overlap an area with other texts or scramble the rest of the sign. - there are many product types and each one has its own html design and css so its very hard to maintain if i need to change things . - different browsers show the sign differently . - different printers print the sign differently.

What would be the best way to approach the problem? could css frameworks help? I'm open for ideas.

share|improve this question
It's technical enough. He's looking for guidance on a technical solution for a problem. Maybe not specific, but general approaches are valid questions. –  bpeterson76 Jun 7 '11 at 19:53
add comment

2 Answers

up vote 1 down vote accepted

I've developed an app that does printing, and HTML layout is about the furthest direction from the path that I would take. HTML printing loses elements such as background, positioning, etc very randomly....and it depends by printer brand and driver. If you're serious about going this route, the only two paths I'd consider doing are Postscript or Adobe PDF. HTML can be a valid "preview" but there again you will be fighting against the discrepancies between how the browsers render your code to the screen--no two are the same. Best still to do a .pdf and just display it.

On my app, I do general layout snapped to a draggable grid in Javascript, then output the coordinates and elements to a database that my (very specialized) printer picks up via an automated text document FTP and reassembles using a proprietary print server. From there, the print server puts all the elements together, positions via grid and outputs the job. It's been months in the making and a huge pain to build, but the outcome is just what my company needed for custom printing on demand. We train all our users to understand that layout is not guaranteed perfect like inDesign or Quark, and even then we get occasional complaints. Bottom line--the web wasn't made to be a print layout tool!

share|improve this answer
add comment

use xml + xslt serverbased transformation . Keep data in standard XML (put that xml in DB) Keep style in XSLT(Select XSLT depending on product company) This could be pretty complex but you can apply style templates in form of xslt . Most browser support this if you do it on server side and stream it .

If you want PDF , HTML ,word docs to be generated then just write XSLFO and use apache xalan framework to create them

share|improve this answer
add comment

Your Answer


