Posted by a ceTe Software moderator
Hello,
The Merger exception you are getting is a typical exception thrown when the PDF is defective. It could be that the original PDF is defective or it might have gotten corrupt during conversion from AssetInputStream to FileOutputStream. Please try the following suggestions to try and narrow down the issue:
1. Create a simple Windows console application in Eclipse or NetBeans and read and save the original PDF using Merger as shown below. If you get the same error, the original PDF is defective.
PdfDocument pdf = new PdfDocument("original.pdf");
MergeDocument document = new MergeDocument(pdf);
document.draw("Output.pdf");
2. Instead of saving the PDF to file system and then opening it again with PdfDocument object, try one of the other
PdfDocument overloads that take the PDF file as byte array or ByteArrayInputStream or FileInputStream.
All that said, please keep in mind that our product is not officially supported on Andorid platform. Some of our customers were able to use it on Android under limited circumstances. However, we have not tested our java library on Android platform except for a few basic examples and there may be many other scenarios or features that do not work. The documentation link on
compatibility has a list of platforms that our product officially supports.
Thanks,
ceTe Software Support Team.