留言板

Print Preview Functionality-Any Help?

Pooja P Joshi,修改在14 年前。

Print Preview Functionality-Any Help?

New Member 帖子: 10 加入日期: 09-11-18 最近的帖子
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,修改在14 年前。

RE: Print Preview Functionality-Any Help?

Liferay Legend 帖子: 1313 加入日期: 06-10-3 最近的帖子
Try popping up the whole page,
and set the media="print" CSS style sheet to screen with a script
thumbnail
Zankar Shah,修改在14 年前。

RE: Print Preview Functionality-Any Help?

Regular Member 帖子: 106 加入日期: 07-10-3 最近的帖子
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,修改在13 年前。

RE: Print Preview Functionality-Any Help?

New Member 帖子: 4 加入日期: 09-10-20 最近的帖子
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,修改在13 年前。

RE: Print Preview Functionality-Any Help?

New Member 帖子: 4 加入日期: 09-10-20 最近的帖子
Found a solution approach at :

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

Worked fine.