473,837 Members | 1,574 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Print versions of HTML cut off at margins

I am trying to print out an HTML document that has MARGINWIDTH set to
1, however, upon printing, HTML table cell contents are cut off, for
exmample:

<table border="0" width="780">
<tr>
<td>Hello, this is a long piece of text that should be printed in
its entirety</td>
</tr>
</table>

However, this is what the user sees upon printout:

Hello, this is a long piece of text that should be printed in its ent
I have set the font settings to be as small as possible and
MARGINWIDTH to 1, to no avail. If the user uses IE to print, it gets
cut off, if I use Firefox 0.6, the font and margins seem small enough
to print everything in its entirety.

What can I do to allow for the users out there to universally print
HTML documents without cutoff? Asking them to switch browsers is
unreasonable and undoable.

Thanx
Phil
Jul 23 '05 #1
18 12445
On 14 Sep 2004 08:01:25 -0700, Phil Powell <ph************ **@gmail.com>
wrote:
I am trying to print out an HTML document that has MARGINWIDTH set to
1, however, upon printing, HTML table cell contents are cut off, for
exmample:

<table border="0" width="780">
<tr>
<td>Hello, this is a long piece of text that should be printed in
its entirety</td>
</tr>
</table>

However, this is what the user sees upon printout:

> Hello, this is a long piece of text that should be printed in its ent

How many pixels wide is the paper? Less than 780?

You've discovered one of the drawbacks of fixed width design.
Congratulations .
I have set the font settings to be as small as possible and
MARGINWIDTH to 1, to no avail. If the user uses IE to print, it gets
cut off, if I use Firefox 0.6, the font and margins seem small enough
to print everything in its entirety.

What can I do to allow for the users out there to universally print
HTML documents without cutoff? Asking them to switch browsers is
unreasonable and undoable.


Using a print stylesheet is recommended.
Jul 23 '05 #2
Phil Powell wrote:
I am trying to print out an HTML document that has MARGINWIDTH set to
1, however, upon printing, HTML table cell contents are cut off, for
exmample:

<table border="0" width="780"> What can I do to allow for the users out there to universally print
HTML documents without cutoff? Asking them to switch browsers is
unreasonable and undoable.


Don't use fixed width tables.

--
Mark.
http://tranchant.plus.com/
Jul 23 '05 #3

"Neal" <ne*****@yahoo. com> wrote in message
news:op******** ******@news.ind ividual.net...
On 14 Sep 2004 08:01:25 -0700, Phil Powell <ph************ **@gmail.com>
wrote:
I am trying to print out an HTML document that has MARGINWIDTH set to
1, however, upon printing, HTML table cell contents are cut off, for
exmample:

<table border="0" width="780">
<tr>
<td>Hello, this is a long piece of text that should be printed in
its entirety</td>
</tr>
</table>

However, this is what the user sees upon printout:

> > Hello, this is a long piece of text that should be printed in its ent

How many pixels wide is the paper? Less than 780?


This leads me to a question that should have occurred to me before: What
*are* browsers treating as a "pixel" for printing purposes? If I'm using a
1200 dpi printer, shouldn't a fixed-width 720 pixel page by printing less
than an inch wide? In fact, that doesn't happen, leading me to think that
something entirely different is going on.

You've discovered one of the drawbacks of fixed width design.
Congratulations .


Jul 23 '05 #4
"Harlan Messinger" <h.*********@co mcast.net> wrote:
What
*are* browsers treating as a "pixel" for printing purposes? If I'm
using a 1200 dpi printer, shouldn't a fixed-width 720 pixel page by
printing less than an inch wide? In fact, that doesn't happen,


It doesn't indeed, and it wasn't meant to happen.

HTML 3.2 said, at the end of the definition of tables:
"Note that pixel values for width and height refer to screen pixels, and
should be multiplied by an appropriate factor when rendering to very high
resolution devices such as laser printers. For instance if a user agent
has a display with 75 pixels per inch and is rendering to a laser printer
with 600 dots per inch, then the pixel values given in HTML attributes
should be multiplied by a factor of 8."
http://www.w3.org/TR/REC-html32.html#table

HTML 4.01 refers (at http://www.w3.org/TR/html4/types.html#h-6.6 ) to the
CSS 1 specification "for information about the definition of a pixel".
And there we find (at http://www.w3.org/TR/REC-CSS1#length-units ) an
interesting "definition ":
"Pixel units - - are relative to the resolution of the canvas, i.e. most
often a computer display. If the pixel density of the output device is
very different from that of a typical computer display, the UA should
rescale pixel values. The suggested reference pixel is the visual angle
of one pixel on a device with a pixel density of 90dpi and a distance
from the reader of an arm's length. For a nominal arm's length of 28
inches, the visual angle is about 0.0227 degrees."

Instead of really defining what a pixel is, it talks about "suggested
reference pixel" and about need to rescale when a device's pixel density
is "very different" from typical screen pixel. This is very vague indeed.
If I change the screen resolution from, say, 1024 by 768 to
1152 by 864 or vice versa, does the density become "very different"?
Browsers seem to think it doesn't. Scaling is performed for print media,
but not according to screen resolution.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 23 '05 #5
"Jukka K. Korpela" <jk******@cs.tu t.fi> wrote in message news:<Xn******* *************** *******@193.229 .0.31>...
"Harlan Messinger" <h.*********@co mcast.net> wrote:
What
*are* browsers treating as a "pixel" for printing purposes? If I'm
using a 1200 dpi printer, shouldn't a fixed-width 720 pixel page by
printing less than an inch wide? In fact, that doesn't happen,


It doesn't indeed, and it wasn't meant to happen.

HTML 3.2 said, at the end of the definition of tables:
"Note that pixel values for width and height refer to screen pixels, and
should be multiplied by an appropriate factor when rendering to very high
resolution devices such as laser printers. For instance if a user agent
has a display with 75 pixels per inch and is rendering to a laser printer
with 600 dots per inch, then the pixel values given in HTML attributes
should be multiplied by a factor of 8."
http://www.w3.org/TR/REC-html32.html#table

HTML 4.01 refers (at http://www.w3.org/TR/html4/types.html#h-6.6 ) to the
CSS 1 specification "for information about the definition of a pixel".
And there we find (at http://www.w3.org/TR/REC-CSS1#length-units ) an
interesting "definition ":
"Pixel units - - are relative to the resolution of the canvas, i.e. most
often a computer display. If the pixel density of the output device is
very different from that of a typical computer display, the UA should
rescale pixel values. The suggested reference pixel is the visual angle
of one pixel on a device with a pixel density of 90dpi and a distance
from the reader of an arm's length. For a nominal arm's length of 28
inches, the visual angle is about 0.0227 degrees."

Instead of really defining what a pixel is, it talks about "suggested
reference pixel" and about need to rescale when a device's pixel density
is "very different" from typical screen pixel. This is very vague indeed.
If I change the screen resolution from, say, 1024 by 768 to
1152 by 864 or vice versa, does the density become "very different"?
Browsers seem to think it doesn't. Scaling is performed for print media,
but not according to screen resolution.


You seem the one that I should ask how to ensure that an HTML page
with tables with set width (or no set width?) can always be printed
out without the margins cutting off text. My company is saying that
certain dynamically-genereated pages after Sept 7 will do this while
none before Sept 7 will do this (no changes to the HTML page that
generates this stuff has been done since Jan 2004).

Thanks
Phil
Jul 23 '05 #6
Jukka K. Korpela.exe failed a Turing test with
If I change the screen resolution from, say, 1024 by
768 to 1152 by 864 or vice versa, does the density become "very
different"? Browsers seem to think it doesn't. Scaling is performed
for print media, but not according to screen resolution.


You'd be more than a little upset if you changed to a higher screen
resolution only to find that all the images increased in size to occupy the
same portion of the screen/window!

Nik

--
I wish to be dissociated from your interpretation of my opinions

This post is encrypted by the Quad-ROT-13 method.
Any attempt to read it may constitute a breach of the DMCA
Jul 23 '05 #7
ph************* *@gmail.com (Phil Powell) wrote:
My company is saying that
certain dynamically-genereated pages after Sept 7 will do this while
none before Sept 7 will do this (no changes to the HTML page that
generates this stuff has been done since Jan 2004).


Sorry, my crystal ball is on vacation. Try posting the URL; maybe someone
wishes to analyze the problem if he can see it.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 23 '05 #8
"Jukka K. Korpela" <jk******@cs.tu t.fi> wrote in message news:<Xn******* *************** *******@193.229 .0.31>...
ph************* *@gmail.com (Phil Powell) wrote:
My company is saying that
certain dynamically-genereated pages after Sept 7 will do this while
none before Sept 7 will do this (no changes to the HTML page that
generates this stuff has been done since Jan 2004).


Sorry, my crystal ball is on vacation. Try posting the URL; maybe someone
wishes to analyze the problem if he can see it.


Sorry, but I can't do that. The URL is an internal URL of US
Government proprietary information, unfortunately, it renders it
somewhat classified, so there is no URL I can give you. All I'm
allowed to do then is to describe the problem as best as possible in
the hopes of a solution.

Thanks
Phil
Jul 23 '05 #9
ph************* *@gmail.com (Phil Powell) wrote:
The URL is an internal URL of US
Government proprietary information


Well, please feel to come back when you have a question about
HTML authoring for the World Wide Web.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 23 '05 #10

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

Similar topics

2
2321
by: Luis Serrano | last post by:
Hi all, I'm trying to generate labels to print in several different formats, all of them with their own height,width and page margins. We've got this done in MS Access 2000, using a designed report that fits with each label type, and reads a table dinamically generated. But the problem is page margins. Does Access store page margins and information of that kind within de report? Is there any kind of association between printer...
6
1703
by: Terry Olson | last post by:
I need to create a Javascript and when the output is printed, I need to control the margins of the printed page very strictly, can Internet Explorers version of CSS do this? Or is there another solution?
0
1830
by: Matthew Belk | last post by:
I am trying to print some 2x6 labels on a SATO CL408e thermal label printer. The 2x6 labels are arranged in "landscape" mode with 2 labels per "sheet." When I attempt to print "x" copies of a 1 page label document, I get "x" formfeeds and "x" wasted labels. Is there any way to manipulate the .NET printing engine to do a over-under 2-up landscape printing? I'm thinking no, but maybe there's a way. The printer has the ability to sense the...
2
1928
by: Ned | last post by:
I'm having difficulty printing on a 4"x3" labels . I set the left margin to 0 but it always prints starting from the middle of the label on the X-axis (no matter what the margin settings are.) I should note that I was able to view the label fine in the PrintPreviewDialog. I checked similar posting but it didn't work for me. I have the following code prior of calling the Print(): PaperSize CustomSize = new PaperSize("CustomSize", 400,...
0
1104
by: Siv | last post by:
Hi, I am working on a VB.NET application that uses the Print Preview. When I call up the print preview and print from my laser printer the whole page comes out no problem. When I do the same using my DeskJet 940c it only prints the top left quarter of the document. Has anyone seen this and know what I am missing, is there some command you send to the printer to say, do the whole page not just the top left quarter?? It's got me...
1
2835
by: scrawnyguns | last post by:
There's probably something easy I'm missing here. When I run a print operation in my program (Microsoft VB.Net Form) I have some code that sets the print margins so that it leaves a nice gap, however, these gaps do not work. No matter what I set the margins to, the printer (HP Color Laserjet) always prints the same (top left corner with about a 5mm gap). Please Help.
7
20739
by: Mark | last post by:
Hi, I am creating application in VB 2005. and when I print report it adds extra 0.45 cm margin on left and top, and the reason for this is physical margins of printer. Is it possible to change printer's physical margins using VB coding? Cheers -- Osmotion Blue
0
2118
by: jigsmshah | last post by:
I need to print a text file .When i print it ,it is not printed exactly form 0,0 coordiante of the page. I mean the top most left corner.It is leaving some margin from top and from left.The code is an example from MSDN. I am using c# 2.0 and VS 2005.I have just chaged the X coordinate for the DrawString function.i am using it as 0 and the Y coordinate is calculated. This is just a test application, as i have to take the printing logic futher...
0
2388
by: thirunavukarasukm | last post by:
Hai.... To print Html page using PrintDialog and Print Document i am created one windows appication.. the windows application have many pages in my booking page i have two buttons one btnprint,btnclose
0
10560
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10263
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9390
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7798
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6987
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5663
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5838
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4468
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3120
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.