Print jquery dialog box contents using scroll bar

So, I create a new jquery ui dialog with the specified height, where the content causes the scroll bar to appear. I have a print button in a dialog box that is designed to print all the contents in a dialog box.

Currently, it prints only visible lines.

Any ideas on how I can print the entire batch?

+4
source share
2 answers

Try using a css table to print, for example:
<link rel="stylesheet" type="text/css" media="print" href="print.css" />

And set the height there.


Update

Try using jQuery.printElement jquery-plugin for your object:

 $('SelectorToPrint').printElement(); 
+7
source

Jason's answer to Print the contents of the DIV , and the plugin he created worked fine for me.

Below is the css value that I added in the Print.css file I am referring to:

 @media print { .Printable { display: block; background-color: white; position: fixed; top: 0; left: 0; margin: 0; padding: 15px; font-size: 14px; line-height: 18px; } .Printable .Content { height: auto; overflow: auto; width: 700px; /* my specific requirement */ margin: 0; padding: 15px; }} $("#Container .Printable").printThis({ debug: false, importCSS: true, printContainer: false, loadCSS: "../Print.css",`` pageTitle: "TITLE", removeInline: false }); <link href="../Print.css" rel="stylesheet" type="text/css" /> <script src="../Scripts/printThis.js"></script> 
0
source

All Articles