HighDots Forums  

CSS, Firefox and printing.

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss CSS, Firefox and printing. in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Clancy
 
Posts: n/a

Default CSS, Firefox and printing. - 04-04-2009 , 07:03 AM






I have always found that CSS is one of the most frustrating things I have to deal with.
Apart from the incredible oversights in its design (like the fact that there is no
provision for defining constants), it does not give any feedback, apart from what you do
(or often don't) get on the screen.

I have recently been working on a program to print envelopes, and got it working
reasonably well, but there were a few minor things where IE6 didn't seem to be working
quite correctly. I had always heard that Firefox was better than Internet Explorer, so I
wondered how it would handle this situation. To my surprise, I found that it did a
substantially worse job than IE 6. In an attempt to understand what was going on, I did a
bit of experimenting, which left me more confused than ever.

You can see my experimental page at http://www.corybas.com/Swindle.htm. This simply
contains two copies of a sample envelope, suitable for printing on a C6 envelope (114 x
162 mm). The garish colours and unsuitable fonts are purely to make it easier to see what
is going on. In the body style the default font is defined as Times new Roman. Separate
styles are defined for the 'address' and 'return' areas of the envelope.

In the top copy the style:

..address_p { font-size: 1.1em; font-family:"Courier New", Courier, mono; line-height:
normal; margin-top: 0; margin-bottom: 0.05em; color:#e00000;}

is defined, and is applied to the cell containing the address. A similar style is defined
for the cell containing the return address.

In the bottom copy the style is defined simply as:

..address_p { font-size: 1.1em; font-family:"Courier New", Courier, mono; line-height:
normal; margin-top: 0; margin-bottom: 0.05em; color:#e00000;}

and is applied directly to each paragraph of the address, with a similar style for the
return.

For @media print {} these styles are overridden by similar styles defining the font as
Arial, the colour as black, and specifying a smaller font size. In IE6 and IE7, the top
copy behaves exactly as I expected in both normal and the print versions. However in the
bottom copy the size specification is ignored, and both the address and the return appear
in the default paragraph size.

In Firefox the screen version behaves in the same way as in IE6, but in the print version
the font specification is also ignored in both cases.

Everything I have read leads me to expect that having defined the style 'address', it
should behave exactly the same whether I apply it directly to each paragraph of the
address, or to the cell containing the address, but clearly this is not so. Can anyone
explain why?

Also is it normal for Firefox to ignore the font specification in the printed version in
both cases? This would appear to be a considerable failure on its part.

(I have simply parked this page on one of my public sites to make it accessible, but I
have made no attempt to integrate it into the site. The original page was produced by a
complex PHP program, but I used IE6 to view the source, and saved it as an HTML file.)

Reply With Quote
  #2  
Old   
Bonnie
 
Posts: n/a

Default Re: CSS, Firefox and printing. - 04-04-2009 , 11:43 AM






Why are you trying to print envelopes from your browser?

--
Bonnie

Clancy wrote:
Quote:
I have always found that CSS is one of the most frustrating things I have to deal with.
Apart from the incredible oversights in its design (like the fact that there is no
provision for defining constants), it does not give any feedback, apart from what you do
(or often don't) get on the screen.

I have recently been working on a program to print envelopes, and got it working
reasonably well, but there were a few minor things where IE6 didn't seem to be working
quite correctly. I had always heard that Firefox was better than Internet Explorer, so I
wondered how it would handle this situation. To my surprise, I found that it did a
substantially worse job than IE 6. In an attempt to understand what was going on, I did a
bit of experimenting, which left me more confused than ever.

You can see my experimental page at http://www.corybas.com/Swindle.htm. This simply
contains two copies of a sample envelope, suitable for printing on a C6 envelope (114 x
162 mm). The garish colours and unsuitable fonts are purely to make it easier to see what
is going on. In the body style the default font is defined as Times new Roman. Separate
styles are defined for the 'address' and 'return' areas of the envelope.

In the top copy the style:

.address_p { font-size: 1.1em; font-family:"Courier New", Courier, mono; line-height:
normal; margin-top: 0; margin-bottom: 0.05em; color:#e00000;}

is defined, and is applied to the cell containing the address. A similar style is defined
for the cell containing the return address.

In the bottom copy the style is defined simply as:

.address_p { font-size: 1.1em; font-family:"Courier New", Courier, mono; line-height:
normal; margin-top: 0; margin-bottom: 0.05em; color:#e00000;}

and is applied directly to each paragraph of the address, with a similar style for the
return.

For @media print {} these styles are overridden by similar styles defining the font as
Arial, the colour as black, and specifying a smaller font size. In IE6 and IE7, the top
copy behaves exactly as I expected in both normal and the print versions. However in the
bottom copy the size specification is ignored, and both the address and the return appear
in the default paragraph size.

In Firefox the screen version behaves in the same way as in IE6, but in the print version
the font specification is also ignored in both cases.

Everything I have read leads me to expect that having defined the style 'address', it
should behave exactly the same whether I apply it directly to each paragraph of the
address, or to the cell containing the address, but clearly this is not so. Can anyone
explain why?

Also is it normal for Firefox to ignore the font specification in the printed version in
both cases? This would appear to be a considerable failure on its part.

(I have simply parked this page on one of my public sites to make it accessible, but I
have made no attempt to integrate it into the site. The original page was produced by a
complex PHP program, but I used IE6 to view the source, and saved it as an HTML file.)

Reply With Quote
  #3  
Old   
Clancy
 
Posts: n/a

Default Re: CSS, Firefox and printing. - 04-05-2009 , 03:23 AM



On Sat, 04 Apr 2009 08:43:30 -0700, Bonnie <bonnie@pixel[occam]plum.com> wrote:

Quote:
Why are you trying to print envelopes from your browser?
Is there any law which says I shall not print envelopes from my browser?

Every couple of years Microsoft bring out new versions of their software, and every time
they change the interface so that simply learning to use it requires a considerable
effort, they make it harder and harder to do what you want to do, as opposed to what they
think you should do, and every time it is slower, even though it is running on a much
faster microprocessor. It has got so bad that the performance of the latest versions of
their software is little better than what we got from CPM on a 10 MHz microprocessor 25
years ago.

About eight years ago I organised a function for about 100 people. I used Word/mail merge
to prepare the mailing list, and it did the job quite efficiently and reasonably
painlessly. A few years later, when I organised the next function, everything had changed,
and I had great difficulty getting Word to do what I wanted. Another couple of years, and
it seemed that Microsoft had decided not to allow me to do the job at all. I eventually
managed to get the job done, after a fashion, but I said enough!

I had become moderately proficient at PHP programming, and a quick look at C++ convinced
me that although it superficially resembled PHP there were enough subtle differences that
I would never be able to program in both at once, so I decided to stick with PHP. I now
have a program which does what I want to do, and which I understand, so I can readily add
new features.

I appreciate that talking to the printer through the browser is not ideal, and the next
step is to learn how to make PHP talk directly to the printer, but until then it enables
me to get the job done.

I don't mind if you think I am mad, but I did ask a legitimate question about
functionality which was presumably provided in the expectation that it would be used.



Reply With Quote
  #4  
Old   
Gary White
 
Posts: n/a

Default Re: CSS, Firefox and printing. - 04-05-2009 , 08:37 AM



On Sat, 04 Apr 2009 22:03:10 +1100, Clancy <clancy_1 (AT) cybec (DOT) com.au> wrote:

Quote:
I have recently been working on a program to print envelopes, and got it working
reasonably well, but there were a few minor things where IE6 didn't seem to be working
quite correctly. I had always heard that Firefox was better than Internet Explorer, so I
wondered how it would handle this situation. To my surprise, I found that it did a
substantially worse job than IE 6. In an attempt to understand what was going on, I did a
bit of experimenting, which left me more confused than ever.

Validate your code. Many questions will be answered.

Gary


Reply With Quote
  #5  
Old   
Bonnie
 
Posts: n/a

Default Re: CSS, Firefox and printing. - 04-05-2009 , 11:00 AM



It's not that I think you are mad; it's just that it's hard enough to
print an envelope in MS Word! As someone who fought the transition to
Word kicking and screaming and was pretty much a master of WordPerfect
through its many DOS iterations and into the transition to Windows, I
was just baffled why you would punish yourself by making it even *more*
complicated!

At least with a WP program you have a fixed idea of actual physical
size, whether in inches or centimeters, and even then there are so many
variables (the default borders of the printer, the different ways the WP
programs handle vertical and horizontal space), I just wondered. Have
no idea how to solve your problem, for myself I am trying to transition
to OpenOffice in the hope it will provide something a bit more stable
that will continue to be supported. Now Sun may be acquired by IBM,
that may be a futile hope, as well.

You have my sympathy but no solution. :-(

--
Bonnie

Clancy wrote:
Quote:
On Sat, 04 Apr 2009 08:43:30 -0700, Bonnie <bonnie@pixel[occam]plum.com> wrote:

Why are you trying to print envelopes from your browser?

Is there any law which says I shall not print envelopes from my browser?

Every couple of years Microsoft bring out new versions of their software, and every time
they change the interface so that simply learning to use it requires a considerable
effort, they make it harder and harder to do what you want to do, as opposed to what they
think you should do, and every time it is slower, even though it is running on a much
faster microprocessor. It has got so bad that the performance of the latest versions of
their software is little better than what we got from CPM on a 10 MHz microprocessor 25
years ago.

About eight years ago I organised a function for about 100 people. I used Word/mail merge
to prepare the mailing list, and it did the job quite efficiently and reasonably
painlessly. A few years later, when I organised the next function, everything had changed,
and I had great difficulty getting Word to do what I wanted. Another couple of years, and
it seemed that Microsoft had decided not to allow me to do the job at all. I eventually
managed to get the job done, after a fashion, but I said enough!

I had become moderately proficient at PHP programming, and a quick look at C++ convinced
me that although it superficially resembled PHP there were enough subtle differences that
I would never be able to program in both at once, so I decided to stick with PHP. I now
have a program which does what I want to do, and which I understand, so I can readily add
new features.

I appreciate that talking to the printer through the browser is not ideal, and the next
step is to learn how to make PHP talk directly to the printer, but until then it enables
me to get the job done.

I don't mind if you think I am mad, but I did ask a legitimate question about
functionality which was presumably provided in the expectation that it would be used.


Reply With Quote
  #6  
Old   
eclipsme
 
Posts: n/a

Default Re: CSS, Firefox and printing. - 04-05-2009 , 11:49 AM




Quote:
Why are you trying to print envelopes from your browser?

Is there any law which says I shall not print envelopes from my browser?

Every couple of years Microsoft bring out new versions of their
software, and every time
they change the interface so that simply learning to use it requires a
considerable
effort, they make it harder and harder to do what you want to do, as
opposed to what they
think you should do, and every time it is slower, even though it is
running on a much
faster microprocessor. It has got so bad that the performance of the
latest versions of
their software is little better than what we got from CPM on a 10 MHz
microprocessor 25
years ago.
Yes, a PITA!
Quote:
About eight years ago I organised a function for about 100 people. I
used Word/mail merge
to prepare the mailing list, and it did the job quite efficiently and
reasonably
painlessly. A few years later, when I organised the next function,
everything had changed,
and I had great difficulty getting Word to do what I wanted. Another
couple of years, and
it seemed that Microsoft had decided not to allow me to do the job at
all. I eventually
managed to get the job done, after a fashion, but I said enough!
Did you upgrade your copy of Word over this time? Were you aware (are
you aware?) that you could still be using your original version of Word?
I don't understand why you kept 'upgrading' once you understood the
version you had.
Quote:
I had become moderately proficient at PHP programming, and a quick
look at C++ convinced
me that although it superficially resembled PHP there were enough
subtle differences that
I would never be able to program in both at once, so I decided to
stick with PHP. I now
have a program which does what I want to do, and which I understand,
so I can readily add
new features.

I appreciate that talking to the printer through the browser is not
ideal, and the next
step is to learn how to make PHP talk directly to the printer,
I don't believe you will ever be able to make this happen. PHP is server
side. Nothing runs on the client. You could, however, try looking at
javascript for this.

Harvey


Reply With Quote
  #7  
Old   
Mark A. Boyd
 
Posts: n/a

Default Re: CSS, Firefox and printing. - 04-05-2009 , 01:50 PM



eclipsme posted in macromedia.dreamweaver

Quote:
Did you upgrade your copy of Word over this time? Were you aware
(are you aware?) that you could still be using your original
version of Word?
I don't understand why you kept 'upgrading' once you understood
the version you had.
Speaking for myself, I had to upgrade now & again when clients began
sending newer docs (& PPTs) incompatible with older versions.

Quote:
I don't believe you will ever be able to make this happen. PHP is
server side. Nothing runs on the client. You could, however, try
looking at javascript for this.
True, but if the server has a printer attached, it might still be a
viable solution for him. I suspect that it would be a lot easier
without a browser, though.

@OP, Clancy, have you considered using PHP to create PDF files? I don't
know how feasible that would be if you're merging a ton of addresses,
but it might be worth considering.


--
Mark A. Boyd
Keep-On-Learnin'


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.