Using PdfBox, how do I retrieve contents of PDDocument as a byte array?
I hope it’s not too late… ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); document.save(byteArrayOutputStream); document.close(); InputStream inputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray()); And voila! You’ve got both input streams!