Foros de discusión

Print Preview Functionality-Any Help?

Pooja P Joshi, modificado hace 14 años.

Print Preview Functionality-Any Help?

New Member Mensajes: 10 Fecha de incorporación: 18/11/09 Mensajes recientes
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
thumbnail
Corné A, modificado hace 14 años.

RE: Print Preview Functionality-Any Help?

Liferay Legend Mensajes: 1313 Fecha de incorporación: 3/10/06 Mensajes recientes
Try popping up the whole page,
and set the media="print" CSS style sheet to screen with a script
thumbnail
Zankar Shah, modificado hace 14 años.

RE: Print Preview Functionality-Any Help?

Regular Member Mensajes: 106 Fecha de incorporación: 3/10/07 Mensajes recientes
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, modificado hace 13 años.

RE: Print Preview Functionality-Any Help?

New Member Mensajes: 4 Fecha de incorporación: 20/10/09 Mensajes recientes
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, modificado hace 13 años.

RE: Print Preview Functionality-Any Help?

New Member Mensajes: 4 Fecha de incorporación: 20/10/09 Mensajes recientes
Found a solution approach at :

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

Worked fine.