Current File : //home/obabain/ms_obaba_in/sipdf4.jsp |
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript">
function printPDF()
{
if (navigator.appName == 'Microsoft Internet Explorer') {
if (typeof document.getElementById("pdfDocument").print == 'undefined') {
setTimeout(function()
{
printPDF("pdfDocument");}, 1000);
}
else {
var x = document.getElementById("pdfDocument");
x.print();
}
} else{
PDFIframeLoad(); // for chrome
}
}
//for Chrome
function PDFIframeLoad() {
var iframe = document.getElementById('iframe_a');
if(iframe.src) {
var frm = iframe.contentWindow;
frm.focus();
frm.print();
return false;
}
}
</script>
<script type="text/javascript">
function goBack() {
window.history.back();
};
</script>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title> </title>
</head>
<body>
<div style="text-align: center;">
<input type="submit" class="btn btn-danger" value="Print"name="Submit" id="printbtn" onclick="printPDF()" />
<input type="button" value="Back" class="btn btn-primary" onclick="goBack()"/>
</div>
<table>
<tr>
<td>
<%String id=request.getParameter("Id");
String copy=request.getParameter("type");
String inv=request.getParameter("inv");
if(inv.equals("1"))
{
%>
<iframe id="iframe_a" name='iframe_a' src="salesInvpdf24.jsp?Id=<%=id %>&type=<%=copy %>" width="850px" height="800px" ></iframe> <!-- for Chrome -->
<%}
else if(inv.equals("2"))
{
%>
<iframe id="iframe_a" name='iframe_a' src="salesInvoicePdf.jsp?Id=<%=id %>&type=<%=copy %>" width="850px" height="800px" ></iframe>
<%}
else if(inv.equals("3"))
{
%>
<iframe id="iframe_a" name='iframe_a' src="salesInvoicepdfSAC.jsp?Id=<%=id %>&type=<%=copy %>" width="850px" height="800px" ></iframe>
<%} %>
<embed type="application/pdf" src="sinvoicepdfdesign.pdf" id="pdfDocument" width="0%" height="0%" >
</embed> <!-- for IE - u can display setted to 0% width and height-->
<input type="submit" value="Print"name="Submit" id="printbtn" onclick="printPDF()" />
<input type="button" value="Back" class="btn btn-info" onclick="goBack()"/>
</td></tr><tr>
<td>
</td>
</tr></table>
</body>
</html>