Beiträge von NetDeveloper

    Thank you for your response Julian,

    Yes. It looks like the canvas and the wrappers' metafile are properly being flushed and disposed. The issue may have something to do the the wrappers internal metafile instance getting corrupted. But still, totally unrelated GDI+ operations end in fatal errors. I was hoping this was a known issue with a fix. Have you been able to duplicated it? Could this be a Microsoft issue?

    Thx,
    Jerry :|

    I am using wPDF version 2.7 and need to be able to create large pdf files. However, I am experiencing all kinds of GDI+ corruption once I hit about 4930+ pages. After the exception, all other GDI rendering is flawed and the program eventually crashes. I put the code I was using in a standalone form app and was able to reproduce. I even removed any painting to the canvas. Here is the very simple code to reproduce:

    The license is blanked out in this sample only. Has anyone seen this issue before? Am I missing something? This is a show stopper for me.
    Thanks!

    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!!! :?

    Has the new syncronization code been added to wPDF file version 2.7 (NET20)? I am running into similar issues while multiple threads are creating PDFs at the same time. Runs for a while and then all threads get exceptions such as:

    Thread1 gets:
    Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

    while in

    System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    at wPDF.wPDFControlDLL.DrawMetafile(Int32 env, IntPtr meta, Int32 x, Int32 y, Int32 w, Int32 h, Int32 xres, Int32 yres)
    at wPDF.wPDFControlWrap.DrawMetafile(Int32 env, IntPtr meta, Int32 x, Int32 y, Int32 w, Int32 h, Int32 xres, Int32 yres)
    at wPDF.PDFControl.CloseCanvas()
    at wPDF.PDFControl.EndPage()

    and on the other thread I get:

    Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

    System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    at wPDF.wPDFControlDLL.StartPage(Int32 env, Int32 Width, Int32 Height, Int32 Rotation)
    at wPDF.wPDFControlWrap.StartPage(Int32 env, Int32 Width, Int32 Height, Int32 Rotation)
    at wPDF.PDFControl.StartPage(Int32 w, Int32 h, Boolean landscape)
    at wPDF.PDFControl.StartPage(ePage format, Boolean landscape)
    at wPDF.PDFControl.StartPage()

    Thank you for any help on this!! :)