Print program design cross-browser

      In the years before I designed a print ActiveX controls, when the market did not match any print control their requirements, so according to their own ideas of design and development of a print control and shared out, did not expect to get a lot of peer friends recognition, I feel pretty good with it.

       Has been for many years, has been by the IE browser of the year or IE as the core browser domestic mainstream, turned to Google's Chrome browser or Chrome as the core of the mainstream of the domestic browser, ActiveX has become yesterday yellow flower. I had so many pieces years later, various techniques are ever-changing, as the print should have is not a problem, when to do their own project development, need to use a bit more complicated print, go online to look for before print found this piece of technology is not much development, Baidu ranked in the top few search of so-called light print control, many years ago and still has the following problems: First, report design cumbersome, both Dangdie mom , both use the JavaScript defined report formats, but also to organize data report, an action window, so you need to calculate the coordinates of each display, and then one by one drawn, so the report design makes mad with them, twelve reports can also correspond barely, if a few more to wearing them, and to safeguard the future modification is also very troublesome. Second, the amount of data printed slightly larger, such as a print dozens of pages of data, the browser stuck there for a long time did not respond, print a larger report, the user and the company's technical service almost crazy . Third, the so-called HTML print, because the browser page and paper, differences in terms of layout and accuracy of control, resulting in pages that display and print the actual effect is far worse, but because the page is generally JS, CSS and other technical design front-end programmer by out, and report development of this work is generally part of the back-end programmers, so he just put back-end development work pushed to the front, the report also difficult to do this one.

       I think as they use with these crappy things, not as his own years ago, the design of print controls upgrade, let it supports all major browsers. Chrome focus on security, robustness and user experience, and print management program requires the user's local printer as the browser page rendering program execution, can not directly control the printer, so this must be done accurately printed by the application. All browsers can call the local program through URL Protocol agreement.

         The overall design concept of this cross-browser print controls are: the server side to a good printed template design, good data organization to the need to print, and then generates a URL to a temporary file, then this URL as a parameter by URL Protocol agreement to call local print controls, print controls download this temporary file, and then parse out print template and print data, and finally direct printing or print preview.

         I have followed this train of thought, write a server-side library and print control, server library is completely open source, provides all the source code, the current source code versions have Java, C #, PHP, for other languages, I have had no used, there is a need to improve their friends can look at. To integrate into your projects, it is relatively simple, I have provided detailed documentation, generally only need to refer to two source files you can call functions directly.

        For print control, because it involves HTTP, JSON and other technology, the C # development faster than C ++, so I'm using .net framework 3.5 development, this framework is the system comes with Win 7, Win 7 for PC and Win 10 does not need to install it again for the old XP you need to install the framework.

         Following the development of this print control, in addition to their own projects after use, I shared with friends, colleagues used their consistent response, stability control is easy to use, compatible with all browsers on Windows systems; speed, print preview 100, need only 5 seconds; high efficiency design, simply drag and drop you can design a perfect Chinese style report; also supports independent online users design reports.

         A friend in need, please join the QQ group: 218 392 762 (group: 135 506 194, the second group: 150 850 837 are full, please join three groups) or ask me directly Q: 12,988,672.


Report preview, edit, and download the development kit URL:   http://www.lc-simple.com/PirntTest/

         

Guess you like

Origin www.cnblogs.com/dong0738/p/10990842.html