extract the pages the client is interested in (there are PDF libraries out there, that can help, e.g. I assume you can only access the full report, and the client can let the server know in which pages the client is interested in: Here is what I (the servlet I wrote) would do: Regarding your second question: I think you should not download the whole PDF first but only the PDF the client is interested in. There is no way to tell the browser where to download a file to. So i split that pdf separately as X.pdf and i send it to his browser andġ)how do i download to a specific location in the above code?example "C:\TEmp\file.pdf"Ģ)How do i send the extracted new pdf file to the browser for the client when he The report repwhole.pdf gets downloaded which has reports for all clients A-Z. How do i achieve this? An example scenario isĪs below. Serverside-the report shud be downloaded and this clients respective pages are there in this report which is to beĮxtracted page wise(which we know per client) and sent to the client. tHeader("cache-control", "must-revalidate") Ĭlientside-The user clicks the download button tHeader("Content-Disposition","attachment filename=\""+newf+"\"") String fileType = fileName.substring(fileName.indexOf(".")+1,fileName.length()) New SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy") įormatter.applyPattern("ddMMyy:HHmmssS") įileBytes=(byte)objec.get("fileBytes") List file=(List)request.getAttribute("file") Ĭalendar calendar = Calendar.getInstance() OutputStream outStream = resp.getOutputStream() Protected void processRequest(HttpServletRequest request, HttpServletResponse resp) I dowloaded a blob file from db using this code.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |