Dear Aspose,
We'd like to report an exception in Aspose.Words v16.6.0 for .NET that occurs while trying to convert a specific multi-page TIFF file to PDF. Upgrading to v17.4.0 doesn't help. The error we get is:
System.Xml.XmlException: Ongeldig teken in de opgegeven codering. Regel 1, positie 1. bij System.Xml.XmlTextReaderImpl.Throw(Exception e) bij System.Xml.XmlTextReaderImpl.InvalidCharRecovery(Int32& bytesCount, Int32& charsCount) bij System.Xml.XmlTextReaderImpl.GetChars(Int32 maxCharsCount) bij System.Xml.XmlTextReaderImpl.ReadData() bij System.Xml.XmlTextReaderImpl.SwitchEncoding(Encoding newEncoding) bij System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean isTextDecl) bij System.Xml.XmlTextReaderImpl.Read() bij System.Xml.XmlReader.MoveToContent() bij ..ctor(Document , Stream , String , ?? , IWarningCallback ) bij .(Byte[] ) bij .(Byte[] ) bij Aspose.Words.DocumentBuilder.InsertImage(Byte[] imageBytes, RelativeHorizontalPosition horzPos, Double left, RelativeVerticalPosition vertPos, Double top, Double width, Double height, WrapType wrapType) bij Aspose.Words.DocumentBuilder.InsertImage(Image image, RelativeHorizontalPosition horzPos, Double left, RelativeVerticalPosition vertPos, Double top, Double width, Double height, WrapType wrapType)
Apologies for the localized error message. Translated: System.Xml.XmlException: Invalid character in the designated encoding. Line 1, position 1.
We only get this error for one specific TIFF file; it triggers the error when we attempt to insert its second image frame into the Aspose.Words document. We're able to convert all other TIFF files successfully. However, we can't seem to find anything wrong with the TIFF file in question, and all viewers we've tried render the image without any problems.
I've managed to reproduce the problem on Windows 10 using a small .NET 4.5.2 project. I'll attach it and the TIFF file to the next post.