I am getting the following exception when I try to call the SaveToFile(string fileName, FileFormat fileFormat) method.
The file name being passed is:
[Path Removed]\84bfd6ab-96f0-4801-8ba9-cf862f41829b\f8245b76-29f4-4060-bafb-c83ad02fc9e4\2590ad05-a1f2-4814-b4e8-785dc354e540_[File Name Removed].pdf.docx
The file format being used is:
FileFormat.Docx2010
The interesting thing about this is this is all standardized code used throughout our application. And the file that is failing is created along with 3 others, all of which are working correctly.
Any help would be greatly appreciated.
Exception:
{System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at System.String.Substring(Int32 startIndex, Int32 length)
at Spire.Doc.Fields.TextRange.get_Text()
at sprᦥ.ᜂ(ParagraphBase A_0)
at sprᦥ.ᜈ(ParagraphBase A_0)
at sprᦥ.ᜀ(ParagraphItemCollection A_0)
at sprᦥ.ᜀ(Paragraph A_0, Boolean A_1)
at sprᦥ.ᜀ(BodyRegion A_0, Boolean A_1)
at sprᦥ.ᜀ(BodyRegionCollection A_0, Boolean A_1)
at sprᦥ.ᜇ(Section A_0)
at sprᦥ.ᜥ()
at sprᦥ.ᜯ()
at sprᦥ.ᜀ(Stream A_0, Document A_1)
at sprᦥ.ᜀ(String A_0, Document A_1)
at Spire.Doc.Document.ᜈ(String A_0)
at Spire.Doc.Document.SaveToFile(String fileName, FileFormat fileFormat)
at [Namespace Removed].LetterParser.ProcessLetter(LetterData letterData, Letter letter) in [File Removed]:line 180}