[RESOLVED] FPDF.Net-System.IndexOutOfRangeException: 'Index was outside the bounds of the array
I am trying to use some code which is a Class, for producing PDF files. (GNU Licence)
IT seems that the code has several errors.
I have tried to change the orientation, which you do in the code that you write.
The default is Portrait which works OK. The line to control this is:
Code:
pdf.AddPage("L")
The error is in the Class code line 1589, at the end of an IF statement. A have attached the FPDF class file.
I'm not experienced enough to correct it and the writer did not answer my email.
The code is available on Sourceforge: https://sourceforge.net/projects/fpdfnet/
Re: FPDF.Net-System.IndexOutOfRangeException: 'Index was outside the bounds of the ar
Well, I don't know if this is the proper fix, but I don't see where the OrientationChanges array is ever redimensioned, other than initially.
So, whether the code will work properly or not logically, you should be able to avoid the exception by doing a redimension of the array at the same place where the pages array is ReDim'd at line 1576. Just copy that line and replace pages with OrientationChanges.