FTP Picture Attachment Batch Printing
Yesterday, a meeting with customers, the need is to batch select pictures to print. From the beginning, I was thinking about whether to do a word print on the server or a direct print on the browser side. Finally select front-end printing, because convenient. But the compatibility is not so good ~
Search information is also see a lot of netizens encounter this kind of problem, so posted out!
Front-end IFRAME printing
var printframe = $ ("<iframe style= ' width:100%;height:100%; ' id= ' printframe ' src= '). /print/printblankpage.html ' ></iframe> ') [0];
$ ("Body"). Append (Printframe);
var isfirstload = true;
Printframe.onload = Printframe.onreadystatechange = function () {
if (this.readystate! = ' complete ' | | (!isfirstload)) Return
else {
Isfirstload = false;
var body = PrintFrame.contentWindow.document.body;
$.each (Filepatharray, function (index, fileName) {
$ (body). Append ("
var FrameWindow = window.open (printFrame.contentWindow.location.href);
FrameWindow.document.open ();
FrameWindow.document.write ($ (body). HTML ());
FrameWindow.document.close ();
Framewindow.print ();
}
};
The document plug content of the window to open, printed after the plug is finished. Several methods have been tried, and this effect is most clear and effective.
"Work Notes"-Dynamic IFRAME content page printing