Hello,
I have two problems
1st: SfPdfViewer ExportAsImages Annotations are removed
Steps to reproduce:
1- Instantiate SfPdfViewer in view controller then load a pdf with LoadDocumentAsync from application's documents folder
2- Call ExportAsImages, extract UIImages and populate a collection view
3- Add any annotation to a page of the loaded pdf, confirm visual feedback on screen, save changes to actual file, confirm annotation added to document by checking the actual file
4- Dismiss view controller, Unload and Dispose instantiated SfPdfViewer
5- Reopen the view controller and load same file, confirm annotation is visible in instantiated SfPdfViewer
6- Call ExportAsImages, extract UIImages and populate a collection view
7- Annotations are not visible
2: If the pdf(see attached zip for exact pdf) has already annotations(any kind) in it, ExportAsImages throwing exception. See below for trace:
"{System.NullReferenceException: Object reference not set to an instance of an object
at Syncfusion.SfPdfViewer.iOS.ScrollViewEx.SaveDocument (Syncfusion.Pdf.Parsing.PdfLoadedDocument m_loadedDocument, System.Boolean flattenForm) [0x004e0] in <8beb620b22ff4a32a008b3e483192ac8>:0
at Syncfusion.SfPdfViewer.iOS.ScrollViewEx+<>c__DisplayClass288_0.<ExportAsImage>b__0 () [0x00000] in <8beb620b22ff4a32a008b3e483192ac8>:0
at Foundation.NSActionDispatcher.Apply () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.18.2.1/src/Xamarin.iOS/Foundation/NSAction.cs:62
--- End of stack trace from previous location where exception was thrown ---
at (wrapper managed-to-native) ObjCRuntime.Messaging.void_objc_msgSend_IntPtr_IntPtr_bool(intptr,intptr,intptr,intptr,bool)
at Foundation.NSObject.InvokeOnMainThread (System.Action action) [0x00007] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.18.2.1/src/Xamarin.iOS/Foundation/NSObject2.cs:605
at Syncfusion.SfPdfViewer.iOS.ScrollViewEx.ExportAsImage (System.Int32 index, System.Single scaleFactor) [0x0004a] in <8beb620b22ff4a32a008b3e483192ac8>:0
at Syncfusion.SfPdfViewer.iOS.SfPdfViewer.ExportAsImage (System.Int32 pageIndex, System.Single scaleFactor) [0x00000] in <8beb620b22ff4a32a008b3e483192ac8>:0
at Syncfusion.SfPdfViewer.iOS.SfPdfViewer.ExportAsImage (System.Int32 pageStartIndex, System.Int32 pageEndIndex, System.Single scaleFactor) [0x00013] in <8beb620b22ff4a32a008b3e483192ac8>:0
at Syncfusion.SfPdfViewer.iOS.SfPdfViewer.ExportAsImage (System.Int32 pageStartIndex, System.Int32 pageEndIndex) [0x00000] in <8beb620b22ff4a32a008b3e483192ac8>:0
at ***.iOS.Views.EditPdfViewController.SetPdfThumbnails () [0x00008] in ***.iOS/Controllers/EditPdfViewController.cs:393 }"
Attachment:
annotationIn2ndPage.pdf_4f293cf7.zip