Web Printing has always been a difficult problem in Web management system, and it has been proved that using lightweight DLL control to achieve Web printing is an ideal solution.
Using the VC ATL technology, combined with IE's print template technology written by Webprint.dll, compressed packaging generated DLL, file download only about 80k, is a lightweight printing control. The following features have been implemented recently:
1, the DLL plug-in function modification
1.1 Increasing the properties of the print URL
Description: When you set the value of this property to a URL link, and then call the print () function to do the printing, you can print the URL link to the Web page.
Grammar: Webprint.printurl=[stringvalue];
Webprint.print (); or Webprint.preview ();
Apply to: Webprint Object
Use examples:
Webprint.initprint ();
Webprint.printurl= "http://www.fcsoft.com.cn";
Webprint.preview (); will see the page you linked to
Note: Webprint is the ID of the print widget.
1.2 Increasing the state properties of the print completion
Description: When you call a DLL control to do a printing document, the document processing completed, successfully sent to the printer processing, this time, this state value will become "over"; that is, when the user is doing the printing document, you can judge the value of the property by callback to determine whether the document is finished printing.
Syntax: webprint.state
Use examples:
Webprint.InitPrint();
Webprint.Print();
……此处需要使用回调来判断是否打印完成。
If (webprint.state==”over”){
Alert(“打印完成!”);
}
Note: Webprint is the ID of the print widget