This doesn't answer your question about margins...and it is not that
cusromizable, but here is some code that I did that prints from Windows
XP, 1024x768. It is made to print out the most common 3x10 labels (3
columns, 10 rows on a page). Hope this will help some.
<html>
<head>
<cfoutput>
<title>Address Labels</title>
<cfinclude template="/inc/metahdr.cfm">
<SCRIPT LANGUAGE="_javascript_">
function printPage() {
if (window.print)
window.print()
else
alert("Sorry, your browser doesn't support this feature.");
}
// -->
</SCRIPT>
</cfoutput>
</head>
<body > <!--- gets query from the database --->
<cfquery name="myQuery" datasource="DSN">
SELECT name, address
FROM TABLENAME
</cfquery>
<cfoutput>
<cfset oldSQL = #getSQL.custSQL#>
<!----- display query results ---------------------------->
<span style="position:absolute; left: 780;"
_javascript_:printPage();">
<input type=submit value="Print!">
</span>
<cfset cnt = 0>
<cfset rowcnt = 1>
<cfset offset = 0>
<cfset labelSpacing = 50>
<cfset divWidth = 215>
<cfset width = divWidth + labelSpacing>
<cfoutput>
<cfloop query="getCustomers">
<cfset cnt = cnt + 1>
<cfset col = cnt MOD 3>
<cfif col eq 1>
<cfset top = (cnt\3) * 95.5 + offset>
<cfset left = 0>
<cfelseif col eq 2>
<cfset top = (cnt\3) * 95.5 + offset>
<cfset left = width>
<cfelseif col eq 0>
<cfset top = ((cnt-1)\3) * 95.5 + offset>
<cfset left = 2 * width>
<cfset col = 3>
</cfif>
<div id=customer#cnt#
style="position: absolute; margin: 0; padding: 0; spacing: 0;
width: #divWidth# ; top: #top#; left: #left#; font-size: x-small;
text-align: top; color: black; text-decoration: 'none';"
> this.style.textDecoration='underline';"
> this.style.textDecoration='none';";>#name#<BR>#address#<BR>#city#,
#st# #zip#</div>
<cfif cnt MOD 3 eq 0>
<cfset rowcnt = rowcnt + 1>
<cfif rowcnt MOD 10 eq 1>
<cfset offset = offset - 43>
</cfif>
</cfif>
</cfloop>
</cfoutput>
</body>
</html>
hth -
Frank
________________________________
From: James Smith [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 30, 2004 7:01 AM
To: CF-Talk
Subject: OT: CSS layer positioning
I am trying to do some page layout with layers and CSS and it is driving
me
insane. The printing position is crucial as it will be printing onto
labels.
1) Is there any way I can control the page borders of the browser as if
two
people have different margins set then the printouts won't match up.
2) If I set up a layer with the following code
<div id="RightLabel#right(OrderNumber,7)#"
style="position:absolute;
left:103mm;
top:#evaluate(283*(currentrow-1) + 223)#mm;
width:86mm;
height:54mm;
z-index:1;
border-color:##000000;
border-style:solid;
border-width:thin">
Then page breaks are ignored and the second layer prints 506mm down the
FIRST page, as each page is only 283mm long this results in the layer
not
getting printed at all. Similarly if I use "top: 223mm" then page
breaks
are still ignored and all the layers are printed in the same place on
the
first page.
These layers are printed from a cfoutput with several records creating
code
in the format
Layer
Pagebreak
Layer
Pagebreak
And so on, but still all layers are treated as if they are on the same
page.
Any one know how to fix this behaviour?
--
James Smith
[EMAIL PROTECTED]
________________________________
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

