We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Multiple Root Elements System.Xml.XmlException

Thread ID:





143207 Mar 8,2019 08:05 PM UTC Mar 11,2019 07:40 AM UTC Xamarin.Forms 1
Tags: PdfViewer
Zach Carls
Asked On March 8, 2019 08:05 PM UTC


I'm getting an exception saying that there are multiple root elements when I try to open the PdfViewer. The file still opens, but I don't know what's causing the exception or how to fix it. My application seems to only break on Android when I'm setting the binding context of my view. I don't have too much more information but here is the stack trace:

System.Xml.XmlException: There are multiple root elements. Line 49, position 2.
  at System.Xml.XmlTextReaderImpl.Throw (System.Exception e) [0x00027] in <2e0be0f40ce3481a960168d707f5b5f1>:0
  at System.Xml.XmlTextReaderImpl.Throw (System.String res, System.String arg) [0x00029] in <2e0be0f40ce3481a960168d707f5b5f1>:0
  at System.Xml.XmlTextReaderImpl.Throw (System.Int32 pos, System.String res) [0x0000c] in <2e0be0f40ce3481a960168d707f5b5f1>:0
  at System.Xml.XmlTextReaderImpl.ParseDocumentContent () [0x001e5] in <2e0be0f40ce3481a960168d707f5b5f1>:0
  at System.Xml.XmlTextReaderImpl.Read () [0x0008c] in <2e0be0f40ce3481a960168d707f5b5f1>:0
  at System.Xml.Linq.XContainer.ReadContentFrom (System.Xml.XmlReader r) [0x00201] in <c4b95a6142f74ba5bf7d7ebaddb77909>:0
  at System.Xml.Linq.XContainer.ReadContentFrom (System.Xml.XmlReader r, System.Xml.Linq.LoadOptions o) [0x00005] in <c4b95a6142f74ba5bf7d7ebaddb77909>:0
  at System.Xml.Linq.XDocument.Load (System.Xml.XmlReader reader, System.Xml.Linq.LoadOptions options) [0x00080] in <c4b95a6142f74ba5bf7d7ebaddb77909>:0
  at System.Xml.Linq.XDocument.Load (System.Xml.XmlReader reader) [0x00000] in <c4b95a6142f74ba5bf7d7ebaddb77909>:0
  at Syncfusion.Pdf.PdfCatalog.ReadMetadata () [0x00103] in <96ea103c151d4af3b40ad4e62cdd8e90>:0

Sathish Sivakumar [Syncfusion]
Replied On March 11, 2019 07:40 AM UTC

Hi Kristen, 
We suspect that the reported issue is specific to the PDF document which is loaded into the SfPdfViewer, so kindly share the PDF document to analyze more on this issue and assist you with the better solution. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon