Is there a way to display specific content when using the printThis jQuery plugin on my website? I've noticed that when I click on print_btn
, images and <hr>
elements are not included in the print. What could be causing this issue?
HTML
<button id="print_btn"></button>
<div class="elementBricka display" style="page-break-after:always">
<div class="lkbLoggo"></div>
<hr>
....
CSS
#elementBrickor{
align-items: center;
}
.elementBricka{
width: 9.614cm;
height: 14.404cm;
border: 1px solid;
background-color: white;
float: none;
margin-left: auto;
margin-right: auto;
}
.lkbLoggo{
width: 9.182cm;
height: 2.721cm;
margin-top: 0.199cm;
background-image: url("/img/lkb_logga2.png");
background-repeat: no-repeat;
background-position: center;
}
JS
$(document).ready(function () {
$('#print_btn').click(function () {
$('.display').printThis({
debug: true,
importCSS: true,
importStyle: true,
loadCSS: "/Data.css",
pageTitle: false,
});
});
});
UPDATE
I have found the solution to my own question.
The issue is not related to "PrintThis".
It seems to be a browser compatibility problem.
By including !important
in my CSS file where I load the image, I was able to resolve the issue.