Use scriptx for page settings in Web Printing

Source: Internet
Author: User

You can use the free feature in scriptx to set pages for web printing, such as headers, footers, and margins. Instructions: http://www.meadroid.com/scriptx/docs/printdoc.htm.

Usage:
Click http://www.meadroid.com/scriptx/bottommost developers canDownloadThe current version of the scriptx archive here. "In the" here ", fill in a mailbox and send the download link to the mailbox. After downloading and installing smsx, go to the installation directory and find the redist folder. the cab and the page to be printed are placed in a directory (which can be used, but you do not need to consider the referenced path ). Another file: smsx.exe is the installation file that is printed. This file can be installed without installation, because the following page will automatically detect and prompt you to install it.

Reference in the page:
<Object ID = "Factory" style = "display: none" viewastext classid = "CLSID: 1663ed61-23eb-11d2-b92f-008048fdd814" codebase = "smsx. Cab # version = 6, 3, 436,14">
</Object>

call JS when printing:
// print parameter settings:
document. all. factory. printing. header = "";
document. all. factory. printing. footer = "";
document. all. factory. printing. leftmargin = 10;
document. all. factory. printing. rightmargin = 10;
document. all. factory. printing. topmargin = 10;
document. all. factory. printing. bottommargin = 10;
document. all. factory. printing. portrait = true // direction, true is vertical, false is horizontal

// Document. All. Factory. Printing. Preview (); // print preview,
// Document. All. Factory. Printing. pagesetup () // print settings
Document. All. Factory. Printing. Print (true) // print, confirm before printing true, print directly if false


You can also save the parameters to cookies and read them before printing each time. In this way, you only need to change the parameters once to implement batch settings.

Unit problem: because no unit is specified here, the default unit of your system is used, so in order to unify, because this is a free version, the function of the specified unit is not provided, so I had to change my computer, the way to modify the unit of http://blog.tao123.com/article.asp? Id = 1142 mentioned in this document:
The operating system of the client computer is Windows XP or win2003:
Go to the control panel, open "region and language options", and click "Custom" on the "region options" page, in the displayed "Custom region options" dialog box, set "Number" to "Metric"

When the operating system of the client computer is Windows 2000:
Go to the control panel, open "area options", select "Number", and set "metering system" to "Metric"

After this change, the margin is in millimeters.

 

You can also save the parameters to cookies and read them before printing each time. In this way, you only need to change the parameters once to implement batch settings.

(I have only some knowledge, but I want to learn it. If not, please point it out. Thank you)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.