473,407 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

typesetting is different when printing :-(

I know HTML was never designed to be WYSIWYG, but with CSS, there is
much greater control over coordinates and dimensions. So I would
expect that a specific piece of text, with a specific font, style, and
size specified in pixels, typeset into a box with a width specified
in pixels, should be identical in both screen and print versions.
This is not the case at least with Internet Explorer 6.

Below is a sample (a pathological case, but it shows the problem).
The number of i's which fit on one line is quite different in screen
and print versions in IE 6 (easily seen with Print Preview).

Is there some way to avoid this difference?
Thanks in advance!

<html>
<style>

#text
{
width: 100px;
background: cyan;
font-family: Verdana;
font-weight: normal;
font-size: 16px;
}

</style>

<body>
<div id="text">
i i i i i i i i i i i i i i i i i i i i i i i i
i i i i i i i i i i i i i i i i i i i i i i i i
i i i i i i i i i i i i i i i i i i i i i i i i
</div>
</body>
</html>
Jul 23 '05 #1
6 2257
Roger Shrubber wrote:
I know HTML was never designed to be WYSIWYG, but with CSS, there is
much greater control over coordinates and dimensions. So I would
expect that a specific piece of text, with a specific font, style, and
size specified in pixels, typeset into a box with a width specified
in pixels, should be identical in both screen and print versions.
This is not the case at least with Internet Explorer 6.

Below is a sample (a pathological case, but it shows the problem).
The number of i's which fit on one line is quite different in screen
and print versions in IE 6 (easily seen with Print Preview).


IE6's printing is particularly poor. Firefox isn't much better. Opera
allegedly has the lead in print capability.

What, in your opinion, is 100px on the paper?

--
Mark.
http://tranchant.plus.com/
Jul 23 '05 #2
ro**************@hotmail.com (Roger Shrubber) wrote:
I know HTML was never designed to be WYSIWYG, but with CSS
This is an HTML discussion group. CSS queries have their own home:
c.i.w.a.stylesheets
, there is
much greater control over coordinates and dimensions.
Danger ahead!
So I would
expect that a specific piece of text, with a specific font, style, and
size specified in pixels
Boom, you just crashed.
, typeset into a box with a width specified
in pixels, should be identical in both screen and print versions.
This is not the case at least with Internet Explorer 6.

Below is a sample (a pathological case, but it shows the problem).
The number of i's which fit on one line is quite different in screen
and print versions in IE 6 (easily seen with Print Preview).

Is there some way to avoid this difference?


Start at the beginning, learn that CSS should not be used in an attempt
to gain total pixel precise control, it will wreck your work. For
example font size expressed in pixels in practice fails to adapt to the
wide range of client side display resolutions and desktop sizes, and IE
users cannot change text size when it's sized in pixels.

--
Spartanicus
Jul 23 '05 #3
On Thu, 7 Oct 2004, Mark Tranchant wrote:
What, in your opinion, is 100px on the paper?


That depends on whether you intend px to stand for pixels
or for CSS px units!
Jul 23 '05 #4
On Thu, 7 Oct 2004, Roger Shrubber wrote:
I know HTML was never designed to be WYSIWYG, but with CSS, there is
much greater control over coordinates and dimensions.
Yes and no. You can *specify* the dimensions in as much detail
as you want, but you can't "control" an arbitrary user's browser.
So I would expect that a specific piece of text, with a specific
font, style, and size specified in pixels, typeset into a box with a
width specified in pixels, should be identical in both screen and
print versions.
That doesn't follow. Printers do all kinds of things with fonts,
including substituting them with others of their choice.
Is there some way to avoid this difference?
In a WWW situation you would do well to free yourself of such
rigidity, since the WWW will continue to do what it does, no matter
how hard you chastise yourself.

If you want to produce a known and reproducible print result, you do
better to produce a PDF version, which you can verify for yourself and
which rates to produce a much more predictable result across different
printers. However, this is no alternative to HTML (+optional CSS) for
the more usual needs of WWW users.
font-family: Verdana;
In a WWW context, you would do well to avoid Verdana.
font-size: 16px;


In a WWW context, you would do well to avoid this kind of font sizing.

The fact that CSS provides something does not, in and of itself, mean
that it's a good idea to use it as part of a WWW design. (And anyway,
this is an HTML group, not a stylesheet group.)

Recommended reading:
http://www.xs4all.nl/~sbpoley/webmatters/verdana.html
http://www.xs4all.nl/~sbpoley/webmatters/fontsize.html

good luck
Jul 23 '05 #5
"Alan J. Flavell" <fl*****@ph.gla.ac.uk> writes:
On Thu, 7 Oct 2004, Mark Tranchant wrote:
What, in your opinion, is 100px on the paper?


That depends on whether you intend px to stand for pixels
or for CSS px units!


If it was CSS px units, shouldn't the browser ask the user how long
their arms are and rescale accordingly if it differs from the
CSS-specified arm length of 28 inches?

--
Chris
Jul 23 '05 #6
Mark Tranchant <ma**@tranchant.plus.com> wrote in message news:<41***********************@ptn-nntp-reader04.plus.net>...
Roger Shrubber wrote:
I know HTML was never designed to be WYSIWYG, but with CSS, there is
much greater control over coordinates and dimensions. So I would
expect that a specific piece of text, with a specific font, style, and
size specified in pixels, typeset into a box with a width specified
in pixels, should be identical in both screen and print versions.
This is not the case at least with Internet Explorer 6.

Below is a sample (a pathological case, but it shows the problem).
The number of i's which fit on one line is quite different in screen
and print versions in IE 6 (easily seen with Print Preview).

What, in your opinion, is 100px on the paper?


Thanks for your reply Mark.

I don't really care what 100px becomes on the paper, as long as what is
printed is very nearly congruent (in the mathematical sense) with what is
on the screen* - that is, it would appear to be WYSIWYG printing to the
user unless he gets out a ruler and starts measuring things. Text that
typesets differently when printed would clearly break this requirement,
especially if it wraps over more lines, which could result in a dud print
with parts cut off, which could in turn result in unhappy users.

As nobody has offered a solution yet, I expect the answer to the original
question may be, "it is not possible to avoid this problem". HTML is not
an ideal medium for attempting WYSIWYG printing, but in this case it is
mandated for other reasons.

Thanks again Mark.
* The screen display consists of a rectangle of a specified size in pixels,
with all coordinates and dimensions given in pixels. So differences in
user window size and font preferences should have no effect on the screen
display, provided the browser honors the recommendations.
Jul 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Geoff Cox | last post by:
Hello, I publish some web pages using large fonts and would like to give the user the opportunity to print the pages using a smaller font. I believe that this is possible using different style...
2
by: neill dumont | last post by:
I've tried to be clear, but this still seems overly complex to me, but here goes: I have a report in front of an aggregate query. I have a single subreport based on the same query for both a...
1
by: eskil | last post by:
Hi, I have an invoice which is being printed on two different trays. This is being done by some simple code in VB, and it works. However, my report goes into design mode in order to change the...
144
by: Natt Serrasalmus | last post by:
After years of operating without any coding standards whatsoever, the company that I recently started working for has decided that it might be a good idea to have some. I'm involved in this...
4
by: Drygast | last post by:
I would like to use the default printer (HP LaserJet 6L) on one form of my app, on another form I would like to use a different printer (DYMO LabelWriter 320). Is this possible to accomplish? ...
1
by: Gidi | last post by:
Hi, I've created a form that prints a document which i created (with the printDocument class), I draw the page's lines and text. when i'm printing it on my computer, with my printer, the...
28
by: richardlang | last post by:
Anyone out there ever come across a preprocessor macro that compares an argument value against the predefined __DATE__ macro in order to control conditional compilation based on date. Something...
4
by: patrik.nyman | last post by:
I have several texts that are to be typeset with minor differences. I do not want to duplicate any xsl-code, so I'm trying to find a way to reuse code, but have changes implemented when...
12
by: =?Utf-8?B?QWxpIFNoYWh6YWQ=?= | last post by:
Hi, asp.net 2.0, ie6, opera 9.22 For various supportability reasons, we need to redirect a page to a url and require that the target url should open in an Opera browser. The call is simple ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.