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
close icon

Multiple Root Elements System.Xml.XmlException


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

1 Reply

SS Sathish Sivakumar Syncfusion Team 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. 

Live Chat Icon For mobile
Up arrow icon