Paged media and CSS

I have an agent that creates an html file. I am trying to format the file with CSS so that the first page prints with a bigger header then every succeeding page. I am have no luck accompliching this task.

For reference here is the LotusScript that actually generates the html file:

'//HTML start===============

Print #fileNum%, {<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">}	

Print #fileNum%, {<html>}

Print #fileNum%, {<head>}

Print #fileNum%, {<title>}

Print #fileNum%, {Cranmer Art Conservation}

Print #fileNum%, {</title>}

Print #fileNum%, {</head>}





'//style==================== 

Print #fileNum%, "<style type=""text/css"" media = ""print"" >"

Print #fileNum%, "@page :first {margin-top: 50cm;}"

Print #fileNum%, "@page  {margin-top: 10cm;}"

'Print #fileNum%, "body {margin: 20cm; font-family : MS Sans Serif; font-size:8pt; }"	

'Print #fileNum%, "body {font-family: verdana;font-size: .75EM;/*margin: 105px 5px 5px 5px;*/}"	

'Print #fileNum%, "@page { margin: 20cm;  /* All margins set to 2cm */ }"

'Print #fileNum%, "@page :first { margin-top: 40cm;    /* Top margin on first page 20cm */ }"	

Print #fileNum%, "</style>"



'//body of the file============

Print #fileNum%, {<body text="#000000" bgcolor="#FFFFFF">}	

Print #fileNum%, {Here is some text}

Print #fileNum%, {<br>}

Print #fileNum%, {Line #2.  I want this to be a long line of text.I want this to be a long line of text.I want this to be a long line of text.I want this to be a long line of text.}







Print #fileNum%, {</body>}

Print #fileNum%, {</html>}



Close filenum%



CreateHTML = filename

The script is printing some dummy data just to see if the CSS is working. When I get that part done I will insert the real table that will be printed.

The html that is being generated looks like this:

Cranmer Art Conservation

@page :first {font-size: 10pt; margin-top: 109cm}

Here is some text


Line #2. I want this to be a long line of text.I want this to be a long line of text.I want this to be a long line of text.I want this to be a long line of text.

Can anyone tell me what is wrong with my CSS? I actually removed this line:

@page :first {font-size: 10pt; margin-top: 109cm}

and replaced it with a simple margin setting line and that worked fine. So I am leading toward something being wrong with my @page line.

Subject: Paged media and CSS

Are you sure you’re testing what you think you’re testing? Your output says the media type is “screen”; the code says “print”. The one can’t come from the other.

Subject: Final thought for Stan Rogers

Stan,

Thanks for the help on this topic. Unfortunately, the problem is not in my code, but in the browser that I am using.

Firefox and IE do not support @page and media selection for printing. In Opera it works like a champ.

Back to the drawing board.

Erskine

Subject: RE: Paged media and CSS

Ooppsss posted the wrong code. The media type should be print.

That is how it is set in my agent, but it is still not printing.

Here is the right html with the lotusscript code:

Cranmer Art Conservation

@page :first {font-size: 10pt; margin-top: 109cm}

Here is some text


Line #2. I want this to be a long line of text.I want this to be a long line of text.I want this to be a long line of text.I want this to be a long line of text.

'//HTML start===============

Print #fileNum%, {}

Print #fileNum%, {}

Print #fileNum%, {}

Print #fileNum%, {}

Print #fileNum%, {Cranmer Art Conservation}

Print #fileNum%, {}

Print #fileNum%, {}

'//style====================

Print #fileNum%, “<style type=”“text/css”" media = ““print”” >"

Print #fileNum%, “@page :first {margin-top: 50cm;}”

Print #fileNum%, “@page {margin-top: 10cm;}”

'Print #fileNum%, “body {margin: 20cm; font-family : MS Sans Serif; font-size:8pt; }”

'Print #fileNum%, “body {font-family: verdana;font-size: .75EM;/margin: 105px 5px 5px 5px;/}”

'Print #fileNum%, “@page { margin: 20cm; /* All margins set to 2cm */ }”

'Print #fileNum%, “@page :first { margin-top: 40cm; /* Top margin on first page 20cm */ }”

Print #fileNum%, “”

'//body of the file============

Print #fileNum%, {}

Print #fileNum%, {Here is some text}

Print #fileNum%, {
}

Print #fileNum%, {Line #2. I want this to be a long line of text.I want this to be a long line of text.I want this to be a long line of text.I want this to be a long line of text.}

Print #fileNum%, {}

Print #fileNum%, {}

Close filenum%

CreateHTML = filename

E

Subject: RE: Paged media and CSS

Ooppsss posted the wrong code. The media type should be print.

That is how it is set in my agent, but it is still not printing.

Here is the right html with the lotusscript code:

Cranmer Art Conservation

@page :first {font-size: 10pt; margin-top: 109cm}

Here is some text


Line #2. I want this to be a long line of text.I want this to be a long line of text.I want this to be a long line of text.I want this to be a long line of text.

'//HTML start===============

Print #fileNum%, {}

Print #fileNum%, {}

Print #fileNum%, {}

Print #fileNum%, {}

Print #fileNum%, {Cranmer Art Conservation}

Print #fileNum%, {}

Print #fileNum%, {}

'//style====================

Print #fileNum%, “<style type=”“text/css”" media = ““print”” >"

Print #fileNum%, “@page :first {margin-top: 50cm;}”

Print #fileNum%, “@page {margin-top: 10cm;}”

'Print #fileNum%, “body {margin: 20cm; font-family : MS Sans Serif; font-size:8pt; }”

'Print #fileNum%, “body {font-family: verdana;font-size: .75EM;/margin: 105px 5px 5px 5px;/}”

'Print #fileNum%, “@page { margin: 20cm; /* All margins set to 2cm */ }”

'Print #fileNum%, “@page :first { margin-top: 40cm; /* Top margin on first page 20cm */ }”

Print #fileNum%, “”

'//body of the file============

Print #fileNum%, {}

Print #fileNum%, {Here is some text}

Print #fileNum%, {
}

Print #fileNum%, {Line #2. I want this to be a long line of text.I want this to be a long line of text.I want this to be a long line of text.I want this to be a long line of text.}

Print #fileNum%, {}

Print #fileNum%, {}

Close filenum%

CreateHTML = filename

E