Whene I open a PDF on the browser I want to print it in a div not all the page. How can I do that? Here is my JSP source code:
<%@ page language="java" import="com.search.ts.*
,java.io.*
,java.net.*
,javax.xml.namespace.QName
,javax.jws.*
,javax.xml.ws.* "
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>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Ebook reader</title>
<%@ page language="java" import="com.search.ts.CallSEI_CallSPort_Client,java.util.*,com.search.ts.Links,com.search.ts.LinksResponse" %>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div id="right_section">
<div class="right_box">
<%
String filename= request.getParameter("err");
//String filename =(String) request.getAttribute("linkbook");
File file = new File("F:/fichiers/", filename+".pdf");
response.setContentType(getServletContext().getMimeType(file.getName()));
response.setContentLength((int) file.length());
response.setHeader("Content-Disposition", "inline; filename=\"" + file.getName() + "\"");
BufferedInputStream input = null;
BufferedOutputStream output = null;
try {
input = new BufferedInputStream(new FileInputStream(file));
output = new BufferedOutputStream(response.getOutputStream());
byte[] buffer = new byte[8192];
int length;
while ((length = input.read(buffer)) > 0) {
output.write(buffer, 0, length);
}
} finally {
if (output != null) try { output.close(); } catch (IOException ignore) {}
if (input != null) try { input.close(); } catch (IOException ignore) {}
}
%>
</div>
</div>
</body>
</html>