Reputation: 67
i want to open a pdf file from a liferay portlet. i tried using window.open() but its not working out for me. the pdf file is residing in c:\MyFolder
<tr>
<td>
<a href="" onclick="javascipt:window.open('C:\\MyFolder\\a.pdf');" class="popup">Click to open.</a>
</td>
</tr>
On clicking the link the page redirects to http://localhost:8080/web/guest/
. Would really appreciate someone's help.
Upvotes: 0
Views: 477
Reputation: 1834
In order to open a PDF
in a new Window
the url should point to any of the following
PDF
file residing on Server
Server
is capable of streaming a PDF
ResourceURL
where your Portlet's serveResource
streams a PDF
Upvotes: 1