.NET20 Limitations or GDI+ bug

  • I am trying to generate a pdf which will be 8250 pages. When I get to around page 4931 (but not always) I get the following exception:

    A generic error occurred in GDI+.

    System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
    at System.Drawing.Graphics.Clear(Color color)
    at wPDF.PDFControl.NeedGraphic()
    at wPDF.PDFControl.StartGraphic()
    at wPDF.PDFControl.StartPage(Int32 w, Int32 h, Boolean landscape)
    at wPDF.PDFControl.StartPage(ePage format, Boolean landscape)
    at wPDF.PDFControl.StartPage()
    at
    ...
    DEBUG [PaintLoop1] CreatePDFService - Pages printed: 4931

    I am using wPDF.dll ver 2.7.2217 and wPDFControl02.dll ver 2.6.1.7. and the following statements:
    ...
    pdf.StartPage();
    TaxPageRenderer.Paint(pdf.Canvas, myPaintXmlNode, img, 1f);
    pdf.Outline(pageName);
    pdf.EndPage();
    ...
    My painting class has full error handling and logging. No probs there.


    When I try to get around it by renaming the file (which is good due to Endpage() call), and I try to use eInputFileMode.AppendToInput, another exception, and the new resulting file had the big 14meg size, but only one page in it!

    Would you have any Ideas as to what I am doing wrong, or is there an accepted limitation?

    Thanks!!! :?