Welcome to the Xamarin.Android feedback portal. We’re happy you’re here! If you have feedback on how to improve the Xamarin.Android, we’d love to hear it!

  • Check out the features or bugs others have reported and vote on your favorites. Feedback will be prioritized based on popularity.
  • If you have feedback that’s not listed yet, submit your own.

Thanks for joining our community and helping improve Syncfusion products!

0
Votes

Hello, I'm developing an Android app using Syncfusion.Xamarin.Pdf module.


In my app. I changed existing FreeTextAnnotation "Markup Text" and save it to a PDF file using Syncfusion.Xamarin.Pdf module.

This worked well until Syncfusion.Xamarin.Pdf v17.2.0.41, but from v17.2.0.46 and later... the text I assigned to FreeTextAnnotation is not reflected in saving the pdf file.


Below is my code example.



            byte[] bPDFbinary = ...;

            using (PdfLoadedDocument PdfDoc = new PdfLoadedDocument(bPDFbinary))

            {

                // Change FreeTextAnnotation Text content

                for (int i = 0; i < PdfDoc.Pages.Count; i++)

                {

                    foreach (PdfLoadedAnnotation Annot in PdfDoc.Pages[i].Annotations)

                    {

                        if (Annot is PdfLoadedFreeTextAnnotation)

                        {

                            PdfLoadedFreeTextAnnotation TextAnnot = Annot as PdfLoadedFreeTextAnnotation;

                            if (String.IsNullOrWhiteSpace(TextAnnot.Text) == false)

                            {

                                string szContent = TextAnnot.Text.Trim();

                                if (szContent.Equals("#Name&Chart#"))

                                {

                                    string szNewContent = "Something...";

                                    TextAnnot.MarkUpText = Annot.Text = szNewContent;   // Change text content

                                }

                                else if (...)

                                {

                                }

                            }

                        }

                    }

                }


                // Save changes

                // until v17.2.0.41.. changes saved well, but from v17.2.0.46 and later.. the changes not saved to binary

                using (System.IO.MemoryStream MemStream = new System.IO.MemoryStream())

                {

                    PdfDoc.Save(MemStream);

                    bPDFbinary = null;

                    bPDFbinary = MemStream.ToArray();

                }

            }



Please review and update.


Thank you.