I can´t open a .pdf in my browser by Java

后端 未结 5 1173
悲&欢浪女
悲&欢浪女 2021-01-16 13:13

I´m trying to open a pdf that I have created using iText library in my browser, but it fails. This is the code I´m using to send to browser

    File file = n         


        
5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-16 13:46

    You should set the Header and ContentType before you write the data. And set the Content Type to application/pdf.

提交回复
热议问题