Web Print summary, web Summary

Source: Internet
Author: User

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!

Related Article

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.