Hi Team,
We are using:
import com.groupdocs.merger.Merger;
import com.groupdocs.merger.domain.options.JoinOptions;
with below code ref to merge two pdf documents:
Map<String, String> map1 = null;
ByteArrayOutputStream mergedPdfOutputStream = new ByteArrayOutputStream();
try {
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(inputPdfBytes);
ObjectInputStream objectInputStream = new ObjectInputStream(byteArrayInputStream);
List<byte[]> pdfByteArrays = producePdfByteArrays((Map<String, String>) objectInputStream.readObject());
// Convert the first byte[] array to InputStream
InputStream firstPdfInputStream = new ByteArrayInputStream(pdfByteArrays.get(0));
// Create GroupDocs Merger instance with the first PDF
Merger merger = new Merger(firstPdfInputStream);
// Loop through the remaining byte[] arrays and merge them
for (int i = 1; i < pdfByteArrays.size(); i++) {
InputStream pdfInputStream = new ByteArrayInputStream(pdfByteArrays.get(i));
merger.join(pdfInputStream, new JoinOptions());
pdfInputStream.close();
}
// Merge and save the output PDF into ByteArrayOutputStream
merger.save(mergedPdfOutputStream);
//close first stream
firstPdfInputStream.close();
Steps to reproduce:
Generate the Merged document. and check the accessibility checks and it generates report with failure.
Steps:
- Open the PDF in Adobe Acrobat Pro.
- Go to All Tools > Prepare for Accessibility > Check for Accessibility.
- Select the desired options and select, Start Checking.
- Review the Accessibility Report, which highlights errors, warnings, and suggestions.
See the checks are failed in below screenshot of report.
acc_merge_pds.jpeg.png (109.2 KB)