I have a List with multiple PDFs , and I want to merge all of them into a single PdfDocument (im using iText) , and then transform this PdfDocument into a ByteArrayOutputStream (OR a byte[]).
public byte[] mergePdfDocumentsIntoAPdfDocument (List<PdfDocument> pdfDocuments){
final ByteArrayOutputStream mergedPdfStream = new ByteArrayOutputStream();
final PdfDocument mergedPdfDocument = new PdfDocument(new PdfWriter(mergedPdfStream));
//I dont know how can I continue this
What should I do in order to achieve this?