...

View Full Version : Printing page Ignores Font size & Orientation



rockyhudson
01-21-2012, 09:02 PM
I am trying to sort out a problem I have with my CSS script for controling the printout.

Some text which is generated from a MySQL database, neesd to be printed in a particular place on the paper, this I have controled using CSS. I have two problems:
1) It does not always printout in the right size font. (The font face is always correct).

2) I have tried to control the page orientation using @page but that does not work.

Here is the CSS code:

/*--Test stylesheet*/

.cc01 { /* Common */
font : 22px 'French Script MT';
color : #000000;
}
@page port {size: portrait;margin: 0cm}
@page land {size: landscape;margin: 0cm}
div#Text { /* <DIV>Text</DIV> */
position : absolute;
left : 10.7cm;
top : 4.2cm;
width : 8cm;
height : 10cm;
}
This is the HTML portion of the PHP script that generates the page to printout:

<html>
<head>
<link rel="stylesheet" type="text/css" href="reset.css" media="screen,projection,print">
<link rel="stylesheet" type="text/css" href="Prn_ScrnDLP.css" media="screen">
<link rel="stylesheet" type="text/css" href="printDLP.css" media="print">
<title> List of Verses</title>

</head>
<body {page: land}>
<div id="Text" class= "cc01" align="center">
<p>
<?php

ECHO $display_block;

?>
</p>
</div>
</body>
</html>

Note:
I have recently added a reset.css as I read this on another forum
reset.css:

/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}


I would appreciate any help as I am new to CSS, HTML and PHP.

felgall
01-21-2012, 10:12 PM
There are no such things as pixels when you print something. Possibly you meant to print it using 22pt rather than using the meaningless 22px.

rockyhudson
01-23-2012, 11:22 PM
Thanks Stephen!

So simple I overlooked it!

Any ideas on the orientation problem?

RockyHudson

felgall
01-24-2012, 09:53 PM
I haven't come across anywhere that indicates that either @page port or [b}@page land[/b] are valid. The only values I know you can put before the { in a @page statement are :first :left and :right - see http://www.w3.org/TR/CSS2/page.html#page-selectors



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum