App is getting crash on removing annotation

Product: PDFTron

brief summary of issue:
On deleting annotation or erasing it with eraser, app is getting crash. Here attaching sample file which is getting crash.

steps to reproduce it:
1.Open below pdf in edit mode
2.Select annotation and delete it from toolbar
3.App is getting crash

Please provide a link to a minimal sample where the issue is reproducible:
PDFtronCrash.pdf (119.1 KB)

Can you help me to identify crash reason and way to solve that.
Thanks.

1 Like

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Hi @rankit.agarwal,

Thank you for getting in touch with us about this.
We are able to reproduce the crash and are investigating.

Do you have any more information about this document or the annotations that you are able to share with us?
How was the document created?
How are the annotations added to the document?

Hi @Jamie_Dassoulas,

I don’t have much idea how the pdf and annotations were created.
but with our previous library and in apple preview we are able to remove annotation, with PDFtron we are getting crash.
Till that is there any approach we can do to avoid crash or atleast we can handle this exception?

Thanks.

1 Like

Hi @Jamie_Dassoulas ,

Is there any update on crash fix? or have you got any way to handle this exception for now?

Thanks.

Hi @rankit.agarwal,

We have been investigating this file and it seems like this is a malformed PDF in the way that the annotations are referenced in the document.
We are investigating the best way to handle this case when deleting annotations from malformed files.

How prevalent is this issue in your app? How often are you seeing crashes like this when trying to delete annotations?

Hi @Jamie_Dassoulas ,

I have checked this same issue with other few files but for other 2-3 files we are getting same issue. it was working fine with our previous library but now we are migrating to PDFtron so, we will need to handle this with PDFtron also. Please let us update if you find any fix or any way to handle.

Thanks.

Hi @rankit.agarwal,

I see, thank you for the information.
We are working on a solution and I will hopefully have an update for you soon.

Hi @rankit.agarwal,

We have an experimental nightly build with a fix for this crash.
It’s available as a DMG download or via CocoaPods:
https://nightly-pdftron.s3-us-west-2.amazonaws.com/experimental/2022-02-02/cocoapods/xcframeworks/pdfnet/2022-02-02_experimental_rev79336.podspec

Are you able to test that and let us know if it resolves the crash?

Hi @Jamie_Dassoulas ,

Thanks for this updated build. Now we are able to remove those annotations with delete button of annotation toolbar. But if we try to erase it with an eraser tool, the app is still getting crash.

Also, we are having same issues with android sdk too. Could you please provide solution for android also

Thanks.

Hi @rankit.agarwal,

Thank you for the test and feedback. We are working on extending the fix to cover all possible deletion paths (e.g. eraser tool).
The Android SDK is also being updated to resolve the issue.

1 Like

Hi @rankit.agarwal,

We have an updated build which should also prevent the crash when using the eraser on these annotations.
Are you able to test it and let us know if it’s working for you?

DMG download

CocoaPods:
https://nightly-pdftron.s3-us-west-2.amazonaws.com/experimental/2022-02-09/cocoapods/xcframeworks/pdfnet/2022-02-09_experimental_rev79377.podspec

Hi @Jamie_Dassoulas ,

Thank you for this updated one. I have tested it and the crash issue is fixed, it is working fine for ios.
If possible can you please also provide android build ?

Thanks.

Hi @rankit.agarwal ,
Please update to Android 9.2.0 and that should be fixed in this version.
Thanks.

Hi @rankit.agarwal,

We also just released version 9.2.0 of our iOS SDK which includes the fix.
Our website will be updated next week but you should be able to update to the new version already.

Please let us know how it works for you.