I'm trying to print a shipping label (4in x 6in) which appears in a bootstrap modal in my application.
This is my CSS for my print media :
@media print {
body * {
visibility: hidden;
}
#print-content * {
visibility: visible;
height: auto;
width:auto;
max-width: 100%;
max-height: 100%;
}
.modal{
position: absolute;
left: 0;
top: 0;
}
@page{
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
margin-bottom: 0px;
}
}
And this is my Modal content that has the Shipping Label Image:
<div class="col-md-12 col-lg-12 col-xs-12 col-sm-12 " id="print-content">
<img class="img-responsive" ng-if="labelLoaded" data-ng-src="data:image/jpeg;base64,{{myImage}}">
<img ng-hide="labelLoaded" ng-src="">
</div>
My image appears fine in my Chrome's "Print Preview" - with the exception that it shows 2 pages instead of one; the second page being completely blank.
I've spent an hour trying to figure out what's wrong - but no progress.
I'm using the Japanese Postcard as the paper size since it's the closest to a shipping label.
What am I missing?