Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Pooja P Joshi
Print Preview Functionality-Any Help?
January 28, 2010 8:14 AM
Answer

Pooja P Joshi

Rank: New Member

Posts: 10

Join Date: November 18, 2009

Recent Posts

Hi All,

Has any one implemented Print Preview Functionality? I have more then one Web Content Display portlets configured in a page along with Print Preview Portlet. On clicking on Print We have to show Print Preview of all Web Content Display portlets only in one Pop up.

Please revert back if any one has any idea/implementation.

Thanks,
-Pooja
Corné Aussems
RE: Print Preview Functionality-Any Help?
January 29, 2010 2:20 PM
Answer

Corné Aussems

Rank: Liferay Legend

Posts: 1279

Join Date: October 3, 2006

Recent Posts

Try popping up the whole page,
and set the media="print" CSS style sheet to screen with a script
Zankar Shah
RE: Print Preview Functionality-Any Help?
January 29, 2010 4:26 PM
Answer

Zankar Shah

Rank: Regular Member

Posts: 105

Join Date: October 3, 2007

Recent Posts

Hi Pooja

I am not sure how can we achieve this OOTB

However you can always customize to create a new page as a pop up (pop up portlet is also not a bad option) which will take the existing articles as parameters and in that portlet you can call API to show all the articles as per needed....
Anil Perim Fernandes
RE: Print Preview Functionality-Any Help?
November 19, 2010 2:31 AM
Answer

Anil Perim Fernandes

Rank: New Member

Posts: 4

Join Date: October 19, 2009

Recent Posts

This may help w.r.t. implementing Print. Though this works fine in FF 3.6.10 and Chrome, it has latency/performance issues in IE 7. Anyone with a fix for this ?

<style type="text/css">
@media print {
#printButton {
display:none;
}
#aui-3-2-0PR1-1339 {
display:none;
}
#dockbar {
display:none;
}
#heading {
display:none;
}
#navigation {
display:none;
}
#breadcrumbs {
display:none;
}
.breadcrumbs lfr-component {
display:none;
}
.portlet-title {
display:none;
}
.portlet-topper {
display:none;
}
#banner {
display:none;
}
.site-breadcrumbs lfr-hudcrumbs{
display:none;
}
}
</style>
<script type="text/javascript">

function ClickHereToPrint(){
try{
var oIframe = document.getElementById('printframe');
var oContent = document.getElementById('termsconditionDiv').innerHTML;
var oDoc = (oIframe.contentWindow || oIframe.contentDocument);
var nav12Css = document.getElementsByTagName('nav');
var i;
for(i=0;i<nav12Css.length;i++){
var nav1Css = document.getElementsByTagName('nav');
nav1Css.parentNode.removeChild(nav1Css);
}
if (oDoc.document) oDoc = oDoc.document;
oDoc.write("<html><head><title>title</title>");
oDoc.write("</head><body style='margin-bottom:-500px;' onload='this.focus(); this.print();'>");
oDoc.write(oContent + "</body></html>");
oDoc.close();
}
catch(e){
self.print();
}
}

Anil Perim Fernandes
RE: Print Preview Functionality-Any Help?
November 24, 2010 10:11 PM
Answer

Anil Perim Fernandes

Rank: New Member

Posts: 4

Join Date: October 19, 2009

Recent Posts

Found a solution approach at :

http://winfolinx.com/tips/howto/various/printready.htm

Worked fine.