Hello,
We are getting an IndexOutOfRangeException when instantiating a MergeDocument object. This has started happening after we migrated our application to .NET 2.0. The following line is the code line raising the exception.
_templateFile = new MergeDocument ( fileName, _options );
_templateFile is a null MergeDocument.
fileName is a string path to a PDF (we checked - it's a valid path)
_options is a MergeOptions constructed with mergeFormFields set to true.
The FAQ mentions that 2.0 is supported. We are running v3.0.1.0 of the Generator and Merger components. Do you have any suggestions why we might be seeing this exception?
Index out of range exception after .Net 2.0 migration
Re: Index out of range exception after .Net 2.0 migration
Support · Jan 20, 2006Actually only version 3.0.3 and up of our Merger product will work with the release version of the Framework 2.0. Prior versions (3.0.1 for example) of our Merger Product did work with Beta 1 and Beta 2 of the Framework 2.0 but they did not work with the final release of .NET 2.0. For Microsoft's final release you must use version 3.0.3 of Merger.
Thanks,
ceTe Software Support Team
Re: Index out of range exception after .Net 2.0 migration
Forum member · Jan 20, 2006Thanks - that explains what we're seeing. Other parts of our app using Generator 3.0.1 (but not Merger) are unaffected. We will update to 3.0.3.
Re: Index out of range exception after .Net 2.0 migration
Forum member · Jan 25, 2006Hi,
We've upgraded to 3.0.3, but we're still getting the index exception. Same line of code from my first post. Can you help?
Re: Index out of range exception after .Net 2.0 migration
Forum member · Jan 25, 2006Here is the stack trace from the calling method on down.
[IndexOutOfRangeException: Index was outside the bounds of the array.]
zz93.aa.d(Int32 A_0) +90
zz93.aa.c(Int32 A_0) +41
zz93.at..ctor(al A_0, Byte[] A_1, Int32 A_2) +123
zz93.aa.a(al A_0, Byte[] A_1, Int32 A_2) +611
zz93.n..ctor(al A_0, Byte[] A_1, Int32 A_2) +68
zz93.at.a(Int32 A_0) +96
zz93.at..ctor(al A_0, Byte[] A_1, Int32 A_2) +106
zz93.aa.a(al A_0, Byte[] A_1, Int32 A_2) +611
zz93.n..ctor(al A_0, Byte[] A_1, Int32 A_2) +68
zz93.at.a(Int32 A_0) +96
zz93.at..ctor(al A_0, Byte[] A_1, Int32 A_2) +106
zz93.ar.a(aw A_0) +205
zz93.u..ctor(PdfDocument A_0, aw A_1) +120
ceTe.DynamicPDF.Merger.PdfDocument.c() +37
ceTe.DynamicPDF.Merger.PdfDocument..ctor(ax A_0, String A_1) +96
ceTe.DynamicPDF.Merger.MergeDocument..ctor(String filePath, MergeOptions options) +52
Re: Index out of range exception after .Net 2.0 migration
Support · Jan 25, 2006It is possible that the PDF you are using is corrupt and cannot be repaired by our product. Can you send the PDF over to [^a|MAILTO:support@cete.com|Support^] and we'll take a look at it for you.
Thanks,
ceTe Software Support Team
Re: Index out of range exception after .Net 2.0 migration
Forum member · Jan 25, 2006Aha!
Thanks. We checked the file path but didn't check the file itself. It seems SourceSafe 2005 converted our PDFs as ANSI files rather than binary data. They certainly were corrupt. Thank you for your help.
Re: Index out of range exception after .Net 2.0 migration
Forum member · Jan 25, 2006In case anyone else runs into this, here is a thread discussing this issue. Time to call Microsoft :)
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=156598&SiteID=1