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
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.