views:

334

answers:

5

One business goal requires that I make a form on screen that's pixel-perfect. If a user prints this form, it will exactly match the US Government Printing Office version of the form; the printer will produce a (reasonably) scannable copy of this document. The previous solution is PDF, which will only work to a certain point for us.

I'm leaning towards HTML/CSS, and would like suggestions on tools to assist that.

For tools, PixelPerfect in Firefox seems a good start. The target platform for this is (drum roll) IE6, if it helps. The document looks like this.

If HTML/CSS is a complete no-go, Adobe Flex is my next choice.

+5  A: 

If pixel perfect printing is the goal, and not even PDF will get you there, you can pretty much give up straight away on printing from the browser. There are waaaay too many variables when rendering on the client side: from different browsers (IE6? Good luck!) to different fonts, to user settings, to A4 vs Letter size paper.

Could I ask why PDF doesn't suit?

nickf
See my post from yesterday: http://stackoverflow.com/questions/1626510/getting-pdf-to-stay-in-an-embedded-object-or-iframe
Dean J
Short version: multiple PDFs embedded into the same screen.
Dean J
I second this one... why can't you use PDF again? If you're trying to get pixel-perfect rendering AND when printing AND cross-browser (INCLUDING IE6) then, like the others, good luck man... you might as well try to summon Bahamut using only your sheer force of will (or materia I guess).
Yadyn
+1  A: 

I agree that pixel-perfect layouts are very, very hard to achieve with html/css, particularly with forms. However, I think pdfs can recieve input from external web forms, or have textfields that when filled out will print.

Flex outputting to pdf would be a good idea, but I don't think using flex as an rendering engine will help too much with this.

Another option would be to make the pdf and use a server-side langage to customize it with fields from a prior webform, and output the result. (Can easily be done with ruby/django/php, there are some good pdf libraries out there.)

CodeJoust
Oh, I'm already customizing the PDF with Java. See my post from yesterday on why PDF might be suboptimal here. http://stackoverflow.com/questions/1626510/getting-pdf-to-stay-in-an-embedded-object-or-iframe
Dean J
+1  A: 

First, abandon pixels. What you're looking for is a print stylesheet, with everything specified using physical units (cm/inches), font size in pt, etc. What is displayed on the screen, in what font size, and whether it is pixel-perfect or not doesn't seem relevant to your requirement of producing a scannable copy.

The question is now, is IE6 support for physical units and print stylesheets complete enough for that? Given my experience with making print stylesheets for clients, where IE would simply crash during the print process if you looked at it wrong, I'd say not too likely -- not with the complexity of the forms you're dealing with.

MaxVT
(Good point. No pun intended.)
Dean J
+1  A: 

If you're worried about the renderer (IE, Acrobat, etc.) screwing up, you could always render the form on the server, and just serve an image to the user.

mbeckish
The form is editable. The pile of requirements on this particular task are very, very high.
Dean J
But how is HTML/CSS easier? Either way, you'll have an HTML form for them to enter the data, then when they submit the form, you either need to specify the HTML/CSS to be drawn, or a bunch of DrawRectangle and DrawString commands, right?
mbeckish
A: 

Dean, check out Prince. Bert Bos and Håkon Wium Lie used it for production of their book on CSS. They explain a bit about it in an A List Apart article.

stephenhay
This seems full of win.
Dean J
I think so. And the cool part is that you can use the same form, but on the web it's web, and on paper it's paper. It's going to be a lot of work, though.
stephenhay