How to merge PDFs from ByteArrayOutputStreams?
Posted on StackOverflow on Jan 13, 2014 by 3vi
The ByteArrayOutputStream
object has a toByteArray()
method that returns a byte[]
. The PdfReader
class has a constructor that takes a byte[] as parameter. Once you have a PdfReader
instance of both files, you can use these instances with PdfCopy
or PdfSmartCopy
to merge the files. Use the Concatenate example for inspiration.