Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Mon Dec 14, 2015 9:29 am

I have a docx document in which some text is replaced, and after saving it to pdf, I get the exception below. When saving to docx, it works.
I can't provide you with a file to reproduce the error (it doesn't fail before replacing the text) but I think the stacktrace speaks for itselve.

I've tested using:
Spire office 2.8.2 Spire Doc 5.1.13.4035

.NET 3.5, Windows 10, Office 2013

I've tried newer Spire versions, but they get another Argument out of range exception, see this support thread.

Thank you,
Robin

Code: Select all
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.Generic.List`1.System.Collections.IList.get_Item(Int32 index)
at Spire.Doc.Collections.ParagraphItemCollection.get_Item(Int32 index)
at Spire.Doc.Hyperlink.3()
at Spire.Doc.Fields.Field.Spire.Doc.Layout.IDocumentWidget.Measure(spr6057 dc)
at spr1416.0(RectangleF A_0)
at spr7818.3(spr6757 A_0)
at spr7818.0(RectangleF A_0)
at spr7317.3(spr6757 A_0)
at spr7818.0(RectangleF A_0)
at spr7818.3(spr6757 A_0)
at spr7818.0(RectangleF A_0)
at spr7818.3(spr6757 A_0)
at spr7818.0(RectangleF A_0)
at spr5372.0(spr6066 A_0, spr5242 A_1, spr6057 A_2)
at spr4071.18()
at spr4071.1(IDocument A_0)
at spr2232.0(Document A_0)
at Spire.Doc.Document.0(Stream A_0)
at Spire.Doc.Document.SaveToFile(Stream stream, FileFormat fileFormat)
at ...

robinvos
 
Posts: 22
Joined: Thu Oct 08, 2015 8:43 am

Tue Dec 15, 2015 2:58 am

Hi,

Thanks for your inquiry.
It is very difficult to resolve the issues if we don't have your original document for investigation.
You can send it to [email protected] if it cannot be shared here. And please share your code.

Please kindly note that we take customer's confidential information as serious as them. We will never publish or disclose any information of our customer. This is always the promise we keep to our customer and the regulation we must obey.

You also provide us an example document doesn't include confidential information and can reproduce the error.
Thank you.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3011
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.PDF