Click here to Skip to main content
15,889,200 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
Hi,
I am facing an issue with print option in firefox and IE9. When i am going into a print preview mode in firefox an extra blank page is being appended to the total pages containing content i.e., if i have content on a single page then firefox displays 2 pages. If the scaling is set to 96% then it fits to single page. The same case in IE9 it gives me 100 pages in print preview mode of which one page contains content and the other 99 pages are blank.

CSS has been written in @media print {} section.


@media print {
html, body { height: auto; }
a div.hds-icon {
height: 30px;
width: 30px;
display:block;
}
.icon.float {
position: absolute;
top: 35%;
right: 1%;
}

.footerImages{
width:21px;
height:21px;
margin-right:7px;
}

a[href]:after{
content:'' !important;
}
.white-wrapper{
margin:0 -15px;
}

.techbulletinPage{
display:block;
margin-left:-15px;
margin-right:-15px;

}
.techbulletinprintFooter{
display:block;
margin-left:-15px;
margin-right:-15px;
}

.leftNavigation.contentleftpar{
display:none;
}

.wrapper.container-fluid.fixed-width{
border:none;
max-width:120%;
width:101%;
}

.mainContent{
border-left:none;
width:100%;
}

.col-xs-12.date-banner .col-md-3.col-xs-6{
display:none;
}

.date-banner {
background-color: #F78E1E;
border:aolid 3px red;
}


.innovative-logo {
min-height: 20%;
background-color: #dbdbdb;
}

.innovative-margin{
padding:25px 0px 25px 35px;
}

/* @media (max-width:1191px){
.innovative-margin{
margin-bottom:0px;
}
} */

/*Sizing for Images*/
.img-width{
width:100%;
}

/*Label updates*/
.new-label{
font-size:20px;
color:#cc1f25;
}


.wrapper{
min-height:10% !important;
}
.new-wrapper{
min-height:75%;
margin:0px auto 0px;
/* box-shadow: 10px 10px 10px #888888; */
}

.white-wrapper{
min-height:10%;
padding:10px 20px;
margin:auto auto;
}

.wrapper.techbulletinPage .row.no-margin{
padding:0;
border-bottom:solid 15px #F78E1E;
}

.wrapper.techbulletinPage.withFooter .row.no-margin{
padding:0;
border:none;
}

.col-xs-12.date-banner{
display:none;
}

/*Custom styling for logos*/
.main-logo{
padding:20px;
margin:10px 0px;
}
.right-logo{
width:121px;
height:60px;
}
.left-logo {
width: 199px;
height: 85px;
}
/* .p-l-20{
padding-left:20px;
}
.p-r-20{
padding-right:20px;
} */
/* .content-area{
resize:none;
border:0px;
padding:30px !important;
} */
.innovative-logo{
min-height:20%;
background-color:#dbdbdb;
}

.wrapper{
background-color:#fff;
}

}


JSP



<!--Start:Image-->


<img src="http://www.hds.com/go/invite/std/images/banner-innovate.jpg" alt="PHitachi Email Header" class="img-width">


<!-- End of print header -->

<!--Start:Date Banner-->
<!--



Newsletter Title




Date


-->

<!--End:Date Banner-->




<!--
<c:set var="created" xmlns:c="#unknown"> <cq:text property="jcr:created" xmlns:cq="#unknown">
<c:set var="createdBy" xmlns:c="#unknown"> <cq:text property="jcr:createdBy" xmlns:cq="#unknown">
<c:set var="lastModified" value="${currentPage.lastModified.time}" xmlns:c="#unknown">
<c:set var="lastModifiedBy" value="${currentPage.lastModifiedBy}" xmlns:c="#unknown">

-->
<c:set var="metadata" value="${techTips}" xmlns:c="#unknown">
<c:set var="userType" value="${userType}" xmlns:c="#unknown">
<c:if test="${wcmEditMode}" xmlns:c="#unknown">
<c:set var="authorUserType" value="${param.authorUserType}">
<c:if test="${empty authorUserType}">
<c:set var="userType" value="${employee}">




<c:choose xmlns:c="#unknown">
<c:when test="${authorUserType eq 'customer'}">
<c:set var="userType" value="${entitled}">

<c:when test="${authorUserType eq 'partner'}">
<c:set var="userType" value="${servicePartnerConstant}">

<c:when test="${authorUserType eq 'employee'}">
<c:set var="userType" value="${employee}">


<c:if test="${wcmEditMode}" xmlns:c="#unknown">


<form action="${currentPage.path}.html">
<c:choose>
<c:when test="${authorUserType eq 'customer'}">
<button type="submit" name="authorUserType" value="employee"
class="btn btn-primary">
<fmt:message key="techtipEmpPreview" xmlns:fmt="#unknown">
</button>
<button type="submit" name="authorUserType" value="partner"
class="btn btn-primary">
<fmt:message key="techtipPartnerPreview" xmlns:fmt="#unknown">
</button>
<button type="submit" name="authorUserType" value="customer"
class="btn btn-primary" disabled=true>
<fmt:message key="techtipCustPreview" xmlns:fmt="#unknown">
</button>

<c:when test="${authorUserType eq 'partner'}">
<button type="submit" name="authorUserType" value="employee"
class="btn btn-primary">
<fmt:message key="techtipEmpPreview" xmlns:fmt="#unknown">
</button>
<button type="submit" name="authorUserType" value="partner"
class="btn btn-primary" disabled=true>
<fmt:message key="techtipPartnerPreview" xmlns:fmt="#unknown">
</button>
<button type="submit" name="authorUserType" value="customer"
class="btn btn-primary">
<fmt:message key="techtipCustPreview" xmlns:fmt="#unknown">
</button>

<c:otherwise>
<button type="submit" name="authorUserType" value="employee"
class="btn btn-primary" disabled=true>
<fmt:message key="techtipEmpPreview" xmlns:fmt="#unknown">
</button>
<button type="submit" name="authorUserType" value="partner"
class="btn btn-primary">
<fmt:message key="techtipPartnerPreview" xmlns:fmt="#unknown">
</button>
<button type="submit" name="authorUserType" value="customer"
class="btn btn-primary">
<fmt:message key="techtipCustPreview" xmlns:fmt="#unknown">
</button>


</form>



<c:choose xmlns:c="#unknown">
<c:when test="${wcmEditMode && empty properties.contentType}">
<img src="/libs/cq/ui/resources/0.gif" class="cq-carousel-placeholder"
alt="Tech Tip ALerts" title="Tech Tip ALerts">

<c:otherwise>

<acl:out currenttype="${userType}" xmlns:acl="#unknown">
allowedTypes="${entitled},${nonentitled},${salesPartnerConstant}">
<cq:include script="customer.jsp" xmlns:cq="#unknown">

<acl:out currenttype="${userType}" xmlns:acl="#unknown">
allowedTypes="${servicePartnerConstant}">
<c:choose>
<c:when test="${fn:contains(pagePath, '/c/')}">
<cq:include script="customer.jsp" xmlns:cq="#unknown">

<c:otherwise>
<cq:include script="partner.jsp" xmlns:cq="#unknown">



<acl:out currenttype="${userType}" allowedtypes="${employee}" xmlns:acl="#unknown">
<c:choose>
<c:when test="${fn:contains(pagePath, '/p/')}">
<cq:include script="partner.jsp" xmlns:cq="#unknown">

<c:when test="${fn:contains(pagePath, '/c/')}">
<cq:include script="customer.jsp" xmlns:cq="#unknown">

<c:otherwise>
<cq:include script="employee.jsp" xmlns:cq="#unknown">






<script type="text/javascript">
setTimeout(function() {
//analytics code
var events = new Array();
/* Define the data needs to be passed to SiteCatalyst */
var data = new Object();
data['prop50'] = "${currentPage.title}";
data['eVar50'] = "${currentPage.title}";
//send to sitecatalyst
recordSitecatEvent(events, data, "prop50");
}, 1500);
</script>

<c:if test="${pageProperties.showTimerLogs}" xmlns:c="#unknown">
<c:set var="end" value="<%=new java.util.Date()%>">
techtip detail.jsp - ${end.time - start.time}


<!-- Start of print footer -->

<!-- End of print footer -->
Posted
Updated 17-Jun-15 2:04am
v3
Comments
ZurdoDev 17-Jun-15 7:44am    
Click improve question and show relevant code.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900