java - how to display pdf file in pop u window in jsp -
i m done pdf view want view dynamically pdf file pop window not download option , save option please give example in java m use code
file f= new file(file); if(f.exists()){ servletoutputstream op= response.getoutputstream(); response.reset(); if(check==1){ response.setcontenttype("application/pdf"); }else{ response.setcontenttype(content); } // response.setheader("content-disposition","attachment; filename=" +filename); byte[] buf = new byte[4096]; int length; datainputstream in = new datainputstream(new fileinputstream(f)); while ((in != null) && ((length = in.read(buf)) != -1)){ op.write(buf,0,length); } in.close(); op.flush(); op.close(); }
this not possible without using external libraries itext.
the ability download or save pdf browser property present in pdf , pdf plugin in browser reads , enable in browser. have disable property in pdf in order browser enforce constraint.
here example link http://www.coderanch.com/t/329511/java/java/revoke-permission-save-copy-pdf
Comments
Post a Comment