• We are using a registered version of RTF2PDF and are seeing an intermittent problem that is proving difficult to resolve.

    RTF2PDF is used by .Net components in COM+ on an application server. .Net code, in a .Net web service, on a separate web server communicates with the COM+ components which in turn use RTF2PDF to create PDF documents using RTFs held in a database.

    For the majority of the time, everyting works successfully, but we see an intermittent issue where COM+ will appear to stop responding to a call. In this case, the COM+ function completes, the document has been successfully created and the 'finally' block of the function successfully logs that it has completed, the call just never responds to the calling code (which throws an RPC error a number of minutes later).

    Could unmanaged code in RTF2PDF be holding onto a resource that prevents COM+ from completing? Are there any sugestions as to the best way to determine what is happening? Any other suggestions/advice would be appreciated.

    Thanks.

    • Offizieller Beitrag

    Hi,

    Also the .NET component uses COM to provide interfaces to the editor. The "Memo" for example uses COM.

    Here it would be interesting to know how complicated Your code is. For pure RTF conversion no COM is required at all.

    The garbage collection removes interfaces some time later, thats pretty bad if the interface needs to do some cleanup. This is why ReleaseInt should be called. (Internally System.Runtime.InteropServices.Marshal.ReleaseComObject(o) is used)

    Julian

  • Thanks for a quick response. The COM+ components are performing a variety of tasks (database reads, updates, sending an email etc.) but the code to perform the rtf to PDF conversion is fairly straightforward:

    wPDF.RTF2PDF rtf2pdf = new wPDF.RTF2PDF();
    rtf2pdf.SetLicense(Configuration.mWPDF3LicenseName, Configuration.mWPDF3LicenseCode, Convert.ToUInt32(Configuration.mWPDF3LicenseNumber));
    rtf2pdf.LoadRTFString(rtfString);
    rtf2pdf.FontMode = wPDF.eFontMode.EmbedTTFSubsetUsedChar;
    rtf2pdf.Encoding = wPDF.eEncoding.Binary;
    rtf2pdf.TextCompression = wPDF.eTextCompression.Deflate;
    rtf2pdf.FileName = "memory";
    rtf2pdf.Print();
    pdfString = rtf2pdf.ResultBuffer;
    rtf2pdf.Dispose();

    I'm not sure I follow the coment about ReleaseInt, is there something on the rtf2pdf object we should be calling to perform this, or is there something else we should be doing with this object before disposing?
    Thanks