Xamarin - Android Form filling.

Hi ,

I have a PDF document having some form fields on it , also some fields containing data on it.

I want to edit this and need to save with updated records as new PDF.

Please let me know ,if any workaround for this. Attaching the sample file

I am using Xamarin - Android SDK for doing the same.

Also using the below code for loading it, which working fine until form fields contains no records , if it's containing some data getting  error "header checksum illegal".

                var inputStream = new MemoryStream();
                string directory = System.IO.Path.Combine(Android.OS.Environment.ExternalStorageDirectory.AbsolutePath);
                string SZ_IMPORT_PATH = System.IO.Path.Combine(directory, "SAMPLE1.pdf");
                using (FileStream file = new FileStream(SZ_IMPORT_PATH, FileMode.Open, FileAccess.Read))
                {
                    byte[] bytes = new byte[file.Length];
                    file.Read(bytes, 0, (int)file.Length);
                    inputStream.Write(bytes, 0, (int)file.Length);
                }
                PdfLoadedDocument lDoc = new PdfLoadedDocument(inputStream, true);
                Syncfusion.Pdf.PdfDocument document = new Syncfusion.Pdf.PdfDocument();
                document.ImportPageRange(lDoc, 0, lDoc.Pages.Count - 1);
                var inputStreamSaved = new MemoryStream();
                document.Save(inputStreamSaved);
                pdfViewer = FindViewById<SfPdfViewer>(Resource.Id.pdfviewercontrol);
                pdfViewer.LoadDocument(inputStreamSaved);


Any help will be appreciated.

Thanks,

Attachment: FormFillingDocument_e566f737.zip

1 Reply

KC Karthikeyan Chandrasekar Syncfusion Team September 24, 2018 12:49 PM UTC

HI Rakesh, 
We have tried to reproduce the reported issue from our side by updating the form fields value for the shared PDF document, imported and saved the document, it worked properly without any issues. We have already faced the “Header checksum illegal” exception when mismatch document compression. This issue may occur when encode and decode the document content, but the document which you have shared is not encoded. As now the reported issue is not reproduced in our side. Can you please provide us more details of your environment.  
  1. Android  SDK version
  2. Call stack of the issue.

Regards, 
Karthikeyan  


Loader.
Up arrow icon