Saya tidak akan mengatakan banyak omong kosong, saya hanya akan memposting kode kepada Anda. Kode spesifiknya adalah sebagai berikut:
<skrip bahasa = "javascript"> function printsetup () {// Pengaturan halaman cetak wb.execwb (8,1); } </script> </head> <body> <objek classid = "clsid: 8856f961-340a-11d0-a96b-00c04fd705a2" tinggi = 0 id = wb nama = wb width = 0> </object> <input type = tombol name = name tombol_setup = "cetakan;Isi pencetakan dikompilasi
1. Kontrol margin "hit vertikal", hit horizontal "dan" halaman.
(1) <Script Disper>
Function SetPrintSettings () {// - Fitur Tingkat Lanjut Factory.printing.setMarginMeasure (2) // Ukur margin di Inches factory.setPagerange (false, 1, 3) // membutuhkan halaman dari 1 hingga 3 factory.printing.printer = "hp deskjet 870c" factory.printing.copies = factory = hp deskjet 870c "factory.crinting.copies = factory = hp deskjet 870c" factory.crinting.copies = factory = factory = 2 factory. 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.leftMargin = 1.0 factory.printing.topMargin = 1.0 factory.printing.rightmargin = 1.0 factory.printing.bottommargin = 1.0} </script>(2)
<skrip bahasa = "javascript"> function printsetup () {// Pengaturan halaman cetak wb.execwb (8,1); } function printPreview () {// Print Page Preview wb.execwb (7,1); } function printit () {if (konfirmasi ('apakah Anda pasti akan mencetak?')) {wb.execwb (6,6)}} </script> </head> <body> <object classid = "clsid: 8856f961-340a-11d0-a96b-00c04fd705a2" name "we = 0.11d0-a96b-00c04fd705" width = 0> </object> <input type = tombol nama = tombol_print value = "print" ontClick = "javascript: printit ()"> <input type = tombol nama = tombol_setup value = "Print Page Pengaturan" OnClick = "JavaScript: PrintSetup ();"> <input type = tombol name = "javascript: printsetup ();"> <input type = tombol name = "javascript: printsetup ();"> <input type = tombol name = "javaScript: printsetup ();"> <input type = tombol name = "javascript: printsetup ();"> <input type = tombol name = "javascript: printsetup ();"> <input type = tombol name = "show value = " Pratinjau "OnClick =" JavaScript: PrintPreview (); "> <input type = tombol nama = tombol_fh value =" tutup "onclick =" JavaScript: window.close (); ">Ada penggunaan lain dari komponen ini, terdaftar sebagai berikut:
WebBrowser.execwb (1,1) Buka
Web.execwb (2,1) Tutup semua Windows IE sekarang dan buka jendela baru
Web.execwb (4,1) Simpan halaman web
Cetak web.execwb (6,1)
Web.execwb (7,1) Prinsip Cetak
Web.execwb (8,1) Pengaturan halaman cetak
Web.execwb (10,1) Lihat Properti Halaman
Web.execwb (15,1) tampaknya dibatalkan, dan itu harus dikonfirmasi
Web.execwb (17,1) Pilih semua
Web.execwb (22,1) Refresh
Web.execwb (45,1) Tutup formulir secara diam -diam
2. Pencetakan paging
<Html> <head> <tyle> p {page-break-after: selalu} </tyle> </head> <body> <%sementara tidak rs.eof%> <p> <%= rs (0)%> </p> <%rs.movenext%> <%wend%> </body> </html>Di atas adalah konten yang relevan dari implementasi fungsi pencetakan Javaweb yang diperkenalkan kepada Anda oleh editor. Saya harap ini dapat membantu Anda!