I require to print a range of images that bring in a query, the range can be very large but when printing mean to choose whether you want to print a certain range by nose images if this has to do with JavaScript or with 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 image that is inside the div is printed, what I try to do is that when you send print ask if I want to print all that were obtained through a query, that rank to rank, or pages
In this image show the results
The image show in other panel,and the user can print this image,but i want that the user can choose to print a range of images that were found with the inquiry ... ie the results
You should attach HTML generated by server...
Anyway - I don't think it's JS problem. CSS can solve your problem - you should read about media="print"
attribute, which can apply CSS only to printed document. I suggest to generate all DIVs with display:none
attribute, and with media="print"
overwrite it to show them all.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With