Results 1 to 3 of 3

Thread: [RESOLVED] FPDF.Net-System.IndexOutOfRangeException: 'Index was outside the bounds of the array

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2015
    Location
    Hastings, UK
    Posts
    137

    Resolved [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/
    Attached Files Attached Files

  2. #2
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,598

    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.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Dec 2015
    Location
    Hastings, UK
    Posts
    137

    Re: FPDF.Net-System.IndexOutOfRangeException: 'Index was outside the bounds of the ar

    Yes this solved the problem!
    Thank you!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width