1. Control the margins of "vertical", horing the "and" page.
(1)
Function setPrintSettings () {
// - Advanced Features
Factory.printing.setMarginMeasure (2) // Measure Margins in inches
Factory.SETPAGERANGE (False, 1, 3) // NEED PAGES from 1 to 3
Factory.printing.printer = "HP Deskjet 870c"
Factory.printing.copies = 2
Factory.printing.collate = TRUE
Factory.printing.Papersize = "a4"
Factory.printing.Papersource = "Manual feed"
// - Basic Features
Factory.printing.Header = "this is meadco"
Factory.printing.footer = "Advanced Printing By Scriptx"
Factory.printing.portrait = false
Factory.printing.LAFTMARGIN = 1.0
Factory.printing.topmargin = 1.0
Factory.printing.rightmargin = 1.0
Factory.printing.bottommargin = 1.0
}
script>
(2)
Function printsetup () {
// Print page settings
Wb.execwb (8, 1);
}
Function printpreview () {
// Print page preview
Wb.execwb (7, 1);
}
Function printit ()
{
IF (confirm ('OK print?')) {
Wb.execwb (6,6)
}
}
script>
hEAD>
P {page-break-after: always}
Style>
HEAD>
<% While Not Rs.eof%>
<% = rs (0)%> p>
<% rs.movenext%>
<% wend%>
Body>
Html>
3, how to get off the path at the bottom of the page and the top page number number when printing
(1) IE's file -> page settings -> The things inside the header and footer are removed, and the printing will not come out.
(2)
DIM HKEY_ROOT, HKEY_PATH, HKEY_KEY
HKEY_ROOT = "HKEY_CURRENT_USER"
HKEY_PATH = "/ Software / Microsoft / Internet Explorer / Pagesetup"
'// Set the page foot foot of the web page
Function Pagesetup_null ()
ON Error ResMe next
Set regwsh = creteObject ("wscript.shell")
HKEY_KEY = "/ header"
RegWsh.Regwrite HKEY_ROOT HKEY_PATH HKEY_KEY, ""
HKEY_KEY = "/ footer"
RegWsh.Regwrite HKEY_ROOT HKEY_PATH HKEY_KEY, ""
END FUNCTION
'// Set the page foot feet of the web page to default
Function Pagesetup_default ()
ON Error ResMe next
Set regwsh = creteObject ("wscript.shell")
HKEY_KEY = "/ header" regWsh.regWrite HKEY_ROOT HKEY_PATH HKEY_KEY, "& W & W & B page, & P / & P"
HKEY_KEY = "/ footer"
RegWsh.Regwrite HKEY_ROOT HKEY_PATH HKEY_KEY, "& U & B & D"
END FUNCTION
script>
HEAD>
p>
Body>
Html>
4, floating frame printing
Function button1_onclick () {
VAR ODOC = WINDOW.IFRAME1.DOCUMENT;
Var r = odoc.body.createtextRange ();
Var stxt = r.htmlText;
Alert (stxt)
VAR PWIN = WINDOW.OPEN ("", "print");
PWin.Document.write (stxt);
PWin.Print ();
}
Script>
4. Implement local specific print in web applications with FileSystem components
Function print_onclick // Print function
Dim label
Label = Document.printinfo.Label.Value // Get data for the HTML page
Set objfs = createObject ("scripting.filesystemObject") / / Create an instance of a FileSystem component object
Set objprinter = objfs.createtextfile ("lpt1:", true) // Establish a connection with the printer
Objprinter.writeline ("________________________________________________") // Output Printing
Objprinter.writeline ("| |")
Objprinter.writeline ("| Your print data is:" & label & "|")
Objprinter.writeline ("| |")
Objprinter.writeline ("| _________________________________ |")
Objprinter.close // Disconnect from the printer
Set objprinter = Nothing
Set objfs = nothing // Turn the FileSystem component object
END FUNCTION
script>
Server-side script:
<% ......... set conn = server.createObject ("adoDb.connection")
CONN.OPEN "DSN = Name; UID = xxxx; pwd = xxxx;"
SET RS = Server.createObject ("AdoDb.Recordset")
Rs.Open ("Select ..."), CONN, 1, 1
..........%> // interact with the database
HTML page encoding:
.........