java - Render PDF using JSP -


this code using in jsp render pdf file

fileinputstream fis = new fileinputstream(path);  int b = 0; while ((b = fis.read()) != -1)  {    out.write(b); } 

path contains location of pdf file stored on local disk. problem: rendering stupid text. not figure out is.

any appreciated. code add/modify

i think least going need set response type "application/pdf". out variable? if its' httpservletresponse, can like:

response.setcontenttype("application/pdf"); 

many approaches doing outlined here: displaying pdf in jsp


Comments

Popular posts from this blog

c++ - How to add Crypto++ library to Qt project -

jQuery Mobile app not scrolling in Firefox -

How to use vim as editor in Matlab GUI -