JS printThis does not print content included in modal

Asked

Viewed 95 times

1

I have a problem with printThis js plugins, it works well on the local machine, but when I try to use it on the server the print file loses the css content and does not show the images and Labels that are in the modal content. I have already tried to edit the plugin options but unsuccessfully.

HTML:

<div id="myModal" class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
<!-- CONTEUDO DO MODAL -->
<div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">

        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">&times;</button>
            <h4 class="modal-title text-center">Participe desta Promoção</h4>
        </div>

        <div class="modal-body">                    
             <div id="print">
                 <input type="hidden" name="voucherId" id="voucherId" value=""/>

                    <img src="" alt="" class="logo-img" name="#voucherImg" id="voucherImg" width="300" height="250">

                    <div class="col-md-12 text-center">
                        <label class="texto "  id="voucherName" name="voucherName"></label>
                    </div>

                    <div class="col-md-12">
                        <label class="texto" id="voucherDesc" name="voucherDesc"></label>       

                    </div>
            </div>
        </div>

        <div class="modal-footer">
            <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
             <button type="button" class="btn btn-primary" id="btnPrint" >Print</button>
        </div>

    </div>
</div>

JS:

$(document).ready(function () {
$("#btnPrint").click(function () {

    $("#print").printThis();
});

});

I’m using this plugin: https://github.com/jasonday/printThis

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.