Beiträge von johne421

    System.Runtime.InteropServices.ExternalException (0x80004005): A generic error occurred in GDI+.
    at System.Drawing.Imaging.Metafile..ctor(IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit, EmfType type, String desc)
    at wPDF.PDFControl.NeedGraphic()
    at wPDF.PDFControl.StartPage(Int32 w, Int32 h, Boolean landscape)

    We have used this successfully for about 18 years... so we are not sure what we are doing wrong. One idea is that we are holding onto a canvas handle that is not being released in a timely manor/thread issues or something that has to do with timing?

    Any thoughts would be great.

    C# code:

    _pdfPrinter.PageMode = ePageMode.Default;
    _pdfPrinter.JPEGCompressMode = eJPEGCompressMode.NoJPEG;
    //(eJPEGCompressMode.JPEG_100 - 1) /* OFF-BY-ONE error in the ENUM definition */;
    _pdfPrinter.InputFileMode = eInputFileMode.IgnoreInput;
    _pdfPrinter.InfoProducer = "xxxxxxxxxxxxxxxxxxxxxxxxxxx";
    _pdfPrinter.Encoding = eEncoding.Binary;
    _pdfPrinter.TextCompression = eTextCompression.Deflate;
                
    _pdfPrinter.PageMode &= ~ePageMode.Outlines;
                
    _pdfPrinter.PDFMode =
    eDevMode.AlwaysHighResPDF |
    eDevMode.AllowTransparentBit; // support image issues to match Delphi
    _pdfPrinter.PDFOptions = ePDFOptions.Empty;
    _pdfPrinter.FontMode = eFontMode.EmbedTTFSubsetCharset;
    _pdfPrinter.PDFEncryption = ePDFEncryption.Empty;
    _pdfPrinter.PDFSecurity = ePDFSecurity.Std40bit;