Printing range images on demand in MYSQL-ASP.NET

I need to print a series of images that bring the request, the range can be very large, but when printing it means to choose whether you want to print a certain range with nose images if it is related to JavaScript or asp, net.

<button name="printButton" id="printButton" type="button" class="btn btn-default" onclick= "printDiv('printableArea');" runat="server"> <span class="glyphicon glyphicon-print"></span> </button> </div> </div> </div> <div class="panel-body"> <div class="panzoom"> <div id="printableArea"> <img src="img/descarga.jpg" alt="Visualización del original de la forma migratoria" class="img-responsive" runat="server"> </div> </div> </div> </div> </section> </div> </div> </div> <script type="text/javascript"> function printDiv(divName) { var printContents = document.getElementById(divName).innerHTML; var originalContents = document.body.innerHTML; document.body.innerHTML = printContents; window.print(); document.body.innerHTML = originalContents; window.onfocus = function () { window.close(); } var $section = $('section').first(); $section.find('.panzoom').panzoom({ $zoomIn: $section.find(".zoom-in"), $zoomOut: $section.find(".zoom-out"), $zoomRange: $section.find(".zoom-range"), $reset: $section.find(".reset") }); }; </script> 

As you can see, only the printed image that is inside the div field, what I'm trying to do is that when you send the print, ask if I want to print everything that was received using the query, this rank for ranking or page

This image shows the results.

To find

printable image

The image is displayed in another panel, and the user can print this image, but I want the user to be able to print a series of images that were found with the request ... i.e. results

+6
source share
1 answer

You must attach the HTML generated by the server ...

Anyway - I don't think this is a JS issue. CSS can solve your problem - you should read about the media="print" attribute, which can only apply CSS to a printed document. I suggest generating all DIVs with the display:none attribute and media="print" rewrite it to show all of them.

+3
source

All Articles