asp.net mvc5+ef6+easyui background Management system (-web) print
Preface
1. This time to make up for the workflow, user form data printing
2. Use Jqprint as Web print plugin
3. Compatible: Firefox,chrome,ie,
4. No dependencies and no configuration, easy to use
Code Download: Https://github.com/tanathos/jquery.jqprint the workflow application form as an example
(because I do not have a printer locally, so eject output to fax and pdf,xps, output to PDF and print the result is actually the same) implementation method
Introduction of related JS
<script src= "~/scripts/jquery.min.js" ></script>
<script src= "~/scripts/jquery.jqprint-0.3.js" ></script>
I use the jquery v1.11.3 here to print
<script language= "javascript" >
function Print () {
$ ("#setFormLayout"). Jqprint ();
</script>
Just specify the div that prints the content, I have the above form included in ID setformlayout, attribute related
$ ("#printContainer"). Jqprint ({
debug:false,//If true you can display IFRAME view effect (iframe default high and wide are very small, can be adjusted in the source code), the default is False
Importcss:true,//true represents the introduction of the original page CSS, the default is true. (If it is true, the $ ("Link[media=print]") is found first, if there is no one to find the CSS file in $ ("link")
printcontainer:true,// Indicates that if the object originally selected must be printed (note: setting to false may break your CSS rules).
operasupport:true//says if the plugin must also support the Opera browser, in this case it provides a temporary print tab. Default is True
});
Printing Effect
Use is too simple, Jqprint source code is also extremely concise and easy to understand