We’re seeing a bunch of crashes in crashlytics for malformed pdf exception. So far we havent been able to reproduce the crash. But seems like users can open the pdf fine they just can’t print it.
Fatal Exception: java.lang.RuntimeException: Cannot print a malformed PDF file
at android.print.PrintManager$PrintDocumentAdapterDelegate$MyHandler.handleMessage(PrintManager.java:1122)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8762)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
Thank you for this information. Would you be able to send us the malformed PDF so we can further investigate? You can submit a Support Ticket with this link: Apryse
We added some analytics to find the root cause for the crash. We found out that the exception was thrown only after adding some annotations on the PDF. Exception wasn’t thrown if the Print job is initiated without adding any annotations. We still don’t know what are the annotations that were added leading to the crash.
Since the SDK collects analytics, would it be possible for us to access those analytics for our app?
This has been submitted internally for further investigation from our Product and Engineering Teams. Once we have more information, this thread will be updated.
Hello, I am updating this post to inform you that this issue has been addressed in the experimental nightly build available here for Android: Apryse Developer Portal
It has been confirmed that the issue initially raised has been fixed. Please let me know if you continue to have issues concerning this.