Question on Java Servlet to open a PDF file using iText

前端 未结 3 1345
北海茫月
北海茫月 2021-01-24 15:34

The code below grabs a PDF file and displays it in the browser.

import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputS         


        
3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-24 16:30

    You aren't using the reader in the second example. I'm not familiar with PdfStamper but I'd guess it uses the reader and thus the contents of your file will be in baos, but not in the second case.

提交回复
热议问题