Problems with Signed PDF Visualization in Xamarin Forms (both iOS and Android)

Hi there,
I am contacting you due to a problem with viewing an externally signed pdf in the pdfviewer (i have the release version 18.3.0.40 ). I'm sure the base64 (and the Stream) of the file contain the signature, but in the viewer only the pdf appears as if it had separated the signature layer. On iOS I don't see the signature, while on Android an error is shown. Could you give me support?

There is the Android error:
 System.NullReferenceException: Object reference not set to an instance of an object.
  at Syncfusion.SfPdfViewer.XForms.Droid.SignatureImageRenderer.MergeImages (Android.Graphics.Bitmap image, Android.Graphics.Bitmap mask) [0x00000] in <3f7f14e0930e4d54ae199bb629c69b6c>:0
  at Syncfusion.SfPdfViewer.XForms.Droid.SignatureImageRenderer.RenderImage (Syncfusion.Pdf.Primitives.PdfDictionary dictionary) [0x00359] in <3f7f14e0930e4d54ae199bb629c69b6c>:0
  at Syncfusion.SfPdfViewer.XForms.Droid.SignatureParser.RenderPath (Syncfusion.SfPdfViewer.XForms.Droid.Base.PdfRecordCollection records) [0x000b8] in <3f7f14e0930e4d54ae199bb629c69b6c>:0
  at Syncfusion.SfPdfViewer.XForms.Droid.SignatureParser..ctor (Syncfusion.Pdf.Parsing.PdfLoadedSignatureField field, Android.Graphics.RectF signatureFieldFrame) [0x0003d] in <3f7f14e0930e4d54ae199bb629c69b6c>:0
  at Syncfusion.SfPdfViewer.XForms.Droid.ScrollViewEx.AddSignatureField (Syncfusion.Pdf.Parsing.PdfLoadedSignatureField signatureField, Syncfusion.SfPdfViewer.XForms.Droid.TransparentCanvas canvas, System.Int32 pageIndex, System.String automationID) [0x00396] in <3f7f14e0930e4d54ae199bb629c69b6c>:0
  at Syncfusion.SfPdfViewer.XForms.Droid.ScrollViewEx.AddExistingFormFields (System.Int32 pageIndex) [0x00278] in <3f7f14e0930e4d54ae199bb629c69b6c>:0
  at Syncfusion.SfPdfViewer.XForms.Droid.ScrollViewEx.M_formFieldsLoaderBgWorker_RunWorkerCompleted (System.Object sender, System.ComponentModel.RunWorkerCompletedEventArgs e) [0x0004d] in <3f7f14e0930e4d54ae199bb629c69b6c>:0
  at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted (System.ComponentModel.RunWorkerCompletedEventArgs e) [0x0000a] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/corefx/src/System.ComponentModel.EventBasedAsync/src/System/ComponentModel/BackgroundWorker.cs:81
  at System.ComponentModel.BackgroundWorker.AsyncOperationCompleted (System.Object arg) [0x0000e] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/corefx/src/System.ComponentModel.EventBasedAsync/src/System/ComponentModel/BackgroundWorker.cs:36
  at Android.App.SyncContext+<>c__DisplayClass2_0.<Post>b__0 () [0x00000] in /Users/builder/azdo/_work/278/s/xamarin-android/src/Mono.Android/Android.App/SyncContext.cs:36
  at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in /Users/builder/azdo/_work/278/s/xamarin-android/src/Mono.Android/Java.Lang/Thread.cs:36
  at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in /Users/builder/azdo/_work/278/s/xamarin-android/src/Mono.Android/obj/Release/monoandroid10/android-28/mcw/Java.Lang.IRunnable.cs:84
  at at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.1(intptr,intptr)


Thanks a lot for the support
Best regards

12 Replies

GT Giuseppe Taormina May 17, 2021 04:16 PM UTC

Summary of my versions: 
Xamarin Forms: 4.8.0.1560
Syncfusion (Licensing and SfpdfViewer): 18.3.0.40 

I attach also the pdf in subject and a screenshot

Thanks a lot
Best Regards


Attachment: archive_pdf_issue_726e86d8.zip


MK Muralitharan Karikalan Syncfusion Team May 18, 2021 06:50 AM UTC

Hi Giuseppe, 
 
Greetings from syncfusion support, 
 
We were able to reproduce the issue, “Application crashes with exception while loading a PDF document which contains signature image” in Xamarin.Forms Android platform in v18.3.0.40 and this issue has been resolved in our latest v19.1.0.63. Kindly update to the mentioned version to get the issue resolved. 
 
Please find the package link below, 
 
However, we found the image content in the signature pad is missing with the provided document in v19.1.0.63. Currently we are validating this issue and we will update the further details on May 20, 2021. 
 
Regards, 
Muralitharan K 



GT Giuseppe Taormina May 19, 2021 08:25 AM UTC

Hi,
thanks a lot for the support. 
Unfortunately, even updating to the latest version of Synfusion (19.1.0.64) the Android application continues to crash and iOS still does not display the signature. I am sending you the latest pdf I have tested. Can you give me support? 
Thank you
Best Regards


Attachment: GDD00100000029365000.pdf_191d20f9.zip


MK Muralitharan Karikalan Syncfusion Team May 20, 2021 04:34 PM UTC

Hi Giuseppe , 
 
We have confirmed that the issue, “Image content in the signature pad is missing” with the document  archive_pdf_issue_726e86d8.zip is a bug and logged a defect report for this. The fix for this issue will be delivered on May 26, 2021. 
 
Please find the feedback link below, 
 
However, the document GDD00100000029365000.pdf_191d20f9.zip contains signature appearance which has JPXDecode type. Currently, we don’t have this support. we will analyze further in this and update you the details on May 24, 2021. 
 
Regards, 
Muralitharan K 



MK Muralitharan Karikalan Syncfusion Team May 25, 2021 05:29 PM UTC

Hi Giuseppe, 
 
On our analysis, we have found that it is not feasible to implement the support to render JPXDecode images in signature form fields as we had earlier faced technical limitations in this type of PDF images with the platform's image rendering APIs themselves. 
 
But we can render the signature by enabling the user to choose whether the signature field with image can be flattened internally. If the signature is flattened, the JPXDecode image will be rendered on the page. As this flattening is performed internally in the PDF viewer only for the purpose of rendering, it will not affect the signature when the PDF is saved from the PDF viewer. Please let us know if this approach is okay for you. 
 
While analyzing we found an issue where the flattened signature is displaced and changed in size. We will validate this issue and will provide the details on May 27, 2021. 
 
However, we will update the patch for the issue, “Image content in the signature pad is missing” with the document  archive_pdf_issue_726e86d8.zip on May 26, 2021 
 
Regards, 
Muralitharan K 



MK Muralitharan Karikalan Syncfusion Team May 26, 2021 05:43 PM UTC

Hi Giuseppe, 
 
In the provided PDF document archive_pdf_issue_726e86d8.zip contains a signature field which has two images and one text appearance. So we have exposed an API to render the signature field by flattening internally. If the signature is flattened, the signature field data will be rendered on the page. And the custom NuGet for the same can be downloaded from the following link         
 
 
Please find the API details: 
 
 
** As this flattening is performed internally in the PDF viewer only for the purpose of rendering, it will not affect the signature when the PDF is saved from the PDFViewer.**     
 
Disclaimer:   
Please note that we have created this NuGet for version 19.1.0.64  specifically to resolve the following issue(s) reported in this/the forum. 165530
 
    
Note : Kindly follow the steps to clear the NuGet cache and then install patched NuGet to get the issue resolved.    
     
 
This fix will be included in our 2021 Volume 2 main release which is expected to be available in the month of June 2021.  
 
However, We will provide the validation details for the issue, “flattened signature is displaced and changed in size” on May 27, 2021. 
 
Regards, 
Muralitharan K 



MK Muralitharan Karikalan Syncfusion Team May 27, 2021 07:07 PM UTC

Hi Giuseppe, 
 
We have confirmed that the issue, “Image content in the signature pad is missing” is a bug from our side. We will resolve this during the implementation of rendering the JPX decode image by flattening  support. Please confirm us whether flattening the signature which has JPX decode image is okay for you? to proceed us further in this implementation. 
 
Regards, 
Muralitharan K 



GT Giuseppe Taormina May 27, 2021 07:33 PM UTC

Hi there,

I confirm your solution and thank you so much.

You can proceed with the implementation

I await your kind reply. 

Best Regards

Giuseppe



GT Giuseppe Taormina May 28, 2021 06:48 AM UTC

Hi there, 
I installed your patch for Android, but when i use the command 



there is a incompatibility error with android system. I followed this procedure: 
1. Delete Nuget SfPdfViewer in the main project and in Android (not SfPdfViewer.Android, which has remained the same as before)
2. I clean up Cache 
3. I manually insert the patch (both on main project and on Android) 
4. Recompile it and run

Is there something wrong?

Does the SfPdfViewer.Android package need to stay the same or should it change with another patch?


Thanks a lot

Best Regards







MK Muralitharan Karikalan Syncfusion Team May 28, 2021 04:28 PM UTC

Hi Giuseppe 
 
Thanks for your confirmation. We will resolve issue, “Signature field does not preserve properly after flattening form field and implement the support to render the signature which has JPX decode type by flattening for the document GDD00100000029365000.pdf_191d20f9.zip and update the patch on  June 18, 2021. 
 
Please find the feedback link below, 
 
Xamarin.Forms project only requires Syncfusion.Xamarin.SfPdfViewer package and the Xamarin native android project only requires the package  Syncfusion.Xamarin.SfPdfViewer.Android 
 
Please find the sample in the below link for your reference,  
  
Please refer the video below to clear NuGet cache and install the NuGet properly, 
  
Regards,  
Muralitharan K  



MK Muralitharan Karikalan Syncfusion Team June 18, 2021 12:59 PM UTC

Hi Giuseppe,    
    
We have resolved the issues “Signature field does not preserve properly after flattening form field” and the custom NuGet for the same can be downloaded from the following link.    
        
 
We have attached the sample to achieve your requirement of  support to render the signature which has JPX decode type by flattening for the document GDD00100000029365000.pdf_191d20f9.zip reference, 
       
Disclaimer: Please note that we have created this NuGet for version v19.1.0.64 specifically to resolve the following issue(s) reported in this/the Forum 165530  
      
Note : Kindly follow the steps to clear the NuGet cache and then install patched NuGet to get the issue resolved.       
        
           
This fix will be included in our 2021 Volume 2 Main release which is expected to available on June 25th , 2021.        
    
Regards,    
Muralitharan K.    



MK Muralitharan Karikalan Syncfusion Team June 30, 2021 12:18 PM UTC

Hi Giuseppe,
  
We are glad to announce that our Essential Studio 2021 Volume 2 release v19.2.0.44  is rolled out and is available for download under the following link. 
  
 
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 
  
Regards,            
Muralitharan K 


Loader.
Up arrow icon