8.5 x 11 In a browser a fools errand?

I need to produce a printable piece of paper. I can do it as a pdf. Normally I use MBS and it does an excellent job of some creating very heave weight insurance documents. But in this case I want it a little more light weight and printing the browser screen is more than enough.

My problem is that the concept of a size of a US letter (8.5 x 11) sheet of paper seems slippery in the browser!

I started with a WebPage of width and Min width of 612 (8.572) and height of 792 (1172) I placed a 612 X 792 pile rectangle on it and printed. I added a same size text box to it and applied a style to control the font.

The rectangle did not fill the page and the text block did not fill the rectangle.

Why?

Is this a case of having to match every single browser and printer?

[quote=92758:@Jay Menna]I need to produce a printable piece of paper. I can do it as a pdf. Normally I use MBS and it does an excellent job of some creating very heave weight insurance documents. But in this case I want it a little more light weight and printing the browser screen is more than enough.

My problem is that the concept of a size of a US letter (8.5 x 11) sheet of paper seems slippery in the browser!

I started with a WebPage of width and Min width of 612 (8.572) and height of 792 (1172) I placed a 612 X 792 pile rectangle on it and printed. I added a same size text box to it and applied a style to control the font.

The rectangle did not fill the page and the text block did not fill the rectangle.

Why?

Is this a case of having to match every single browser and printer?[/quote]

HTML was never able to do very well layouts. Seems it has not changed. You could probably generate a picture file US Letter size by printing to it the same way you would print with an OpenPrinterDialog(). Then you display it with showURL for the user to print.

I am not quite sure the browser zoom level would not get in the way, though.

Opening a PDF in Acrobat Reader still seems like a much more reliable way to print, even though heavier.

Why did it not fill the page… do the math.

you created a web object that was 612 pixels wide (this of course did not account for the non-printable area of your printer, but we will skip that for now). Your SCREEN is probably much wider (1280? 1440? more?)

As Michel pointed out… HTML is for the most part device independent… and most pages will fit to your screen layout.

Try looking at CSS and the media tags… that might help… It allows printed layouts to differ from screen layouts

One of the best examples is when an HTML page is loaded into a phone browser. It fits the screen width although the effective screen width of an iPad 4 with 320 pix is largely under the designed 800 pix or more screen. In an older experiment, I created an HTML page with graphic rulers : the 320 pixels wide screen showed 13 inches 1/2 !

If the HTML for the document is loaded into a WebHTMLViewer then it should respect the page size settings, at least that is what I find.

The MBS DynaPDF plugin gives very accurate control over page size and layout so it is my preferred solution.

Problem is for a web application you never can assume anything about the client browser.

I tend to think that indeed PDF is the only way to be sure about the printing.