I am using DynamicPDF version 4.0.2.20
i am getting "System.IndexOutOfRangeException: Index was outside the bounds of the array" when using the Draw function of Document class.
I get this exception only when i ran my application in window7 machine.It works fine when i ran same application in Win XP.
Stack Trace :
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at zz93ag.a()
at zz93ag..ctor(Byte[] A_0, Int32 A_1)
at zz93i5..ctor(TiffImageData A_0, zz93jn A_1)
at ceTe.DynamicPDF.Imaging.TiffImageData.a()
at ceTe.DynamicPDF.Imaging.TiffImageData.b()
at ceTe.DynamicPDF.Imaging.TiffImageData.Draw(PageWriter writer, Single pdfX, Single pdfY, Single width, Single height)
at ceTe.DynamicPDF.PageElements.BackgroundImage.Draw(PageWriter writer)
at ceTe.DynamicPDF.PageElements.Group.Draw(PageWriter writer)
at ceTe.DynamicPDF.Page.b(PageWriter A_0)
at ceTe.DynamicPDF.Page.DrawEntries(DocumentWriter writer, Int32 pageNumber, Int32 sectionPageNumber)
at ceTe.DynamicPDF.Page.a(DocumentWriter A_0, Int32 A_1, Int32 A_2, Int32 A_3)
at zz93aa.d(Int32 A_0)
at zz93aa.v()
at ceTe.DynamicPDF.Document.Draw(String filePath)
My Code where i am getting exception :
ceTe.DynamicPDF.Document masterDoc = null;
MemoryStream stream = new MemoryStream();
streamList.Add(stream);
this._chart.Export.Image.TIFF.Height = _chart.Height;
this._chart.Export.Image.TIFF.Width = _chart.Width;
this._chart.Export.Image.TIFF.Save(stream);
ceTe.DynamicPDF.Imaging.TiffFile tiffFile = new ceTe.DynamicPDF.Imaging.TiffFile(stream);
if (masterDoc == null)
{
masterDoc = tiffFile.GetDocument();
}
else
{
masterDoc.Pages.Add(tiffFile.GetDocument().Pages[0]);
}
masterDoc.Draw("FileName.PDF"); //This is were i am getting exception
Getting System.IndexOutOfRangeException only in Windows7 and not in XP
Re: Getting System.IndexOutOfRangeException only in Windows7 and not in XP
Support · Aug 8, 2011Hello,
Can you please let us know what build of our DynamicPDF product you are using? Please try using the latest dll file in your application and see if it works for you. You can download the latest dll files by logging into our CustomerArea: http://www.DynamicPDF.com/CustomerArea/
using your product serial number. Remove reference for the old dll file and reference the latest dll file in your application.
If you continue getting the similar error even after using the latest dll file then please send over the Tiff image with which you are getting error to our support team at: [^a|mailto:support@cete.com|opennewiwndow|support@cete.com^] so that they can look into it further.
Thanks,
ceTe Software Support Team.