Web Print summary, web Summary
One requirement in the project is to print the winform client on the webpage by the customer. The printing requirement is implemented according to a certain format.
The solution at that time was to use PDF printing:
1. Prepare a formatted basemap;
2. Open the basemap and draw dynamic content to the bottom;
3. Use the Modified Image in step 2 to generate a PDF file for printing.
Later I found a relatively powerfulWeb printing tool lodopIs described as follows:
1. Check whether the plug-in is installed in the browser:
Http://www.lodop.net/demolist/PrintSample1.html
2. Create html. This portal opens a graphical editing page. The generated result is as follows:
<Html> <body> <object id = "LODOP" classid = "clsid: 2105C259-1E0C-4534-8141-A753534CB4CA" width = 0 height = 0> </object> <script> function myPreview () {LODOP. PRINT_INIT ("test template") ;};</script> <a href = "javascript:;" onclick = "javascript: myPreview (); LODOP. PRINT_DESIGN (); "> go to template design </a> </body>
3. We can create an image with the matching document, import this graphic interface as the background image, and then put the text box and other content to start the test.
4. After positioning, you can click the overall align icon in the upper left corner to make unified adjustments.
5. Remove the background image, generate the code, and put it into the JS Code segment.
LODOP. PRINT_INIT ("Test Set template"); LODOP. ADD_PRINT_TEXT (107,225,338, 30, "bidder name"); LODOP. SET_PRINT_STYLEA (0, "FontSize", 15); LODOP. ADD_PRINT_TEXT (421,116,209, 26, "mobile phone number"); LODOP. SET_PRINT_STYLEA (0, "FontSize", 13 );
<Html> <body> <object id = "LODOP" classid = "clsid: 2105C259-1E0C-4534-8141-A753534CB4CA" width = 0 height = 0> </object> <script> function myPreview () {LODOP. PRINT_INIT ("Test Set template"); LODOP. ADD_PRINT_TEXT (107,225,338, 30, "bidder name"); LODOP. SET_PRINT_STYLEA (0, "FontSize", 15); LODOP. ADD_PRINT_TEXT (421,116,209, 26, "mobile phone number"); LODOP. SET_PRINT_STYLEA (0, "FontSize", 13) ;}; </script> <a href = "javascript:;" onclick = "javascript: myPreview (); LODOP. PRINT_DESIGN (); "> go to template design </a> </body>
6. Changes to the JS parameter nature
Summary:
The difficulty of PDF is to accurately calculate the location of the content to be filled, which is troublesome for debugging. lodop is a graphical interface, which facilitates debugging and simple syntax and is easy to dissolve in JavaScript, here is just a simple list of a simple instance, more functions, refer to the official site address: http://www.lodop.net
The above is all the content of this article. I hope this article will help you in your study or work. I also hope to provide more support to the customer's home!