Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Printing problems

227 views
Skip to first unread message

joem...@gmail.com

unread,
Oct 21, 2006, 7:09:16 AM10/21/06
to
I had this same problem with mozilla 1.7.7 & 1.7.13. Currently, I am
using Firefox 1.5.0.7. I am trying to print a webpage
(http://www.flipcode.com/articles/article_advstrings01-pf.shtml) and
the formating of the source code examples is messed up or cut off. It
looks fine until you look closely at it. There are words cut off and
the code examples are cut off too. I have had this problem before.
What are my options? How can I fix it?

I found a work around for now. Mozilla and FIrefox can't seem to
print these pages right. Words end up being missing because they are
cut off, and the source code examples end up being jumbled. Here's my
current work around:

1. Install IE Tab.

2. Load the page & switch to IE using IE Tab.

3. Select File->Print Preview (which will launch IE's print priview)

4. Play arond with the settings till it looks right.

Is there a better way of fixing this problem? Also, the web page I
posted above causes the problems for me in both print preview & print
in Firefox (& mozilla).
jmccay

Leonidas Jones

unread,
Oct 21, 2006, 2:49:24 PM10/21/06
to

I copy/paste what I want to print into a word processor. It gives much
more control, and may work better then your workaround. At least its
another option.

I gave up trying to print directly from FF/TB/SM/Suite quite a while
ago. I think its a low priority, with the felling that there shouldn't
be much need to print web pages, which generally do not print well under
the best of circumstances. That's true for me. I don't think I've ever
needed to print a complete web page.

Lee

--
Leonidas Jones, Mozilla/Netscape Champion
Learn about the Champs! http://mozillachampions.ufaq.org
The UFAQ'S http://www.ufaq.org/
http://www.mozilla.org/community/etiquette.html
http://mozilla.com http://mozilla.org

Alex

unread,
Oct 22, 2006, 6:11:55 AM10/22/06
to

I see that Lee has already answered, with probably the easiest solution.
But, because I'm the curious type, I decided to play with it a bit.

There seem to be two issues here.

First, that the words in the source code listings get mangled together &
second, that the code listings get cut off, if they have long lines.

First, I changed my monospace font from "Courier" or "Courier New" (I
forgot which it was, exactly) to Bitstream Vera Sans Mono:

Tools > Options > Content > Fonts & Colors > Advanced > Monospace

Then, below that, I UNchecked "Allow pages to use their own fonts, ..."
This was necessary because the author specified the Courier fonts in
the HTML source for those code examples.

That cleared up the mangled/overlapping source code. Note that I picked
that font just because it was listed as the first choice for a
programming font, here: http://www.lowing.org/fonts/

There are many, many more listed there, but I did not test them to see
how they behaved.

It appears that, for whatever reason, FF has a problem rendering the
Courier fonts, at least in print mode. Note that YYMV. I am currently
using a HP932C. If you have a different printer, you may see different
results.

Next, I went to Print Preview & set the orientation to Landscape. I
also made sure that the Scale: was set to 100%, as I've seen problems
before when this was set to Shrink to Fit, which is the default setting.
This allowed the source code to fit on the page.

The problem with the code not fitting on the page is that there are some
extremely long lines in the code examples and they are tagged with
<pre>, for preformatted. This tells the browser to show it exactly as
it is written in the underlying HTML source, in other words, do not wrap
this text.

Normally, the text is dynamic, that is, it will re-wrap to fit the width
of the browser window, or in the case of printing, the paper size &
margin settings. You can see this with the narrative text when you
resize the browser window. But the <pre> tag overrides this behavior.

You will notice that, if you resize your browser window smaller, you
will see that horizontal scroll bars appear in some of the longer source
code examples. This is the result of the <pre> tag & long lines.

If the author had used shorter line lengths in the code examples, then
it would not have been necessary to use the Landscape orientation.

As an afterthought, I don't use it myself, but I wonder if Greasemonkey
could be used to:

a) specify the Bitstream Vera Sans Mono, or any other suitable (usable)
font for <pre> tags, and
b) break up long lines within <pre> tags?

That way, you could still allow the majority of sites out there to
specify the fonts, but still accommodate source code listings with long
line lengths.

I really don't know anything about it myself, other than hearing that it
can alter a page before it is displayed, apparently through the use of
Javascript. Maybe someone out there with experience with Greasemonkey
scripts can chime in?

--
Alex

jmccay

unread,
Oct 29, 2006, 8:23:06 PM10/29/06
to
Thanks Alex. Your tips worked on one of my computers. Now I need to
test it on the others. I don't think I want to try greasemonkey just
yet. Maybe in the future. I just don't have the time to learn
something like that because I got enough on my plate to learn at the
moment.
jmccay

Alex

unread,
Oct 30, 2006, 7:00:02 AM10/30/06
to

You're welcome.

In the future, if you would, please bottom post in these newsgroups.
That is, place your reply below the quoted text. Thanks.

I'm in the same boat at the moment, just so many other things going on,
my plate is rather full at the moment, too.

But it is something on my list :-)

--
Alex

0 new messages