I am trying to load the license file of iText7 in my Dot Net application (C# programming language). I have given the correct path to the json file using the syntax mentioned below.
LicenseKey.LoadLicenseFile(new FileStream(@"pathtofile\iTextKey.json", FileMode.Open));
The error message I get is:
Data at the root level is invalid. Line 1, position 1.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at iText.License.Util.XmlWorker..ctor(Stream stream)
at iText.License.LicenseKey.LoadLicenseFileInternal(Stream licenseIs)
at iText.License.LicenseKey.LoadLicenseFile(Stream licenseIs)
I verified the JSON file and it looks okay to me.
Any help to resolve this issue will be of great help.