掲示板

Print Preview Functionality-Any Help?

14年前 に Pooja P Joshi によって更新されました。

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
14年前 に Corné A によって更新されました。

RE: Print Preview Functionality-Any Help?

Liferay Legend 投稿: 1313 参加年月日: 06/10/03 最新の投稿
Try popping up the whole page,
and set the media="print" CSS style sheet to screen with a script
thumbnail
14年前 に Zankar Shah によって更新されました。

RE: Print Preview Functionality-Any Help?

Regular Member 投稿: 106 参加年月日: 07/10/03 最新の投稿
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....
13年前 に Anil Perim Fernandes によって更新されました。

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();
}
}

13年前 に Anil Perim Fernandes によって更新されました。

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.