2 Replies Latest reply: Jan 13, 2012 2:13 PM by ashokinb1 RSS

    Remote Procedure Call Fail - PDF to PS generation

    ashokinb1 Community Member

      Hi,

       

      A custom application is developed to convert PDF files to Postscript format. Occasionally we get "Remote procedure call failed" error message. The log trace is copied below. Please help on this regard.

       

       

      System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)

         at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)

         at Microsoft.VisualBasic.CompilerServices.VBBinder.InvokeMember(String name, BindingFlags invokeAttr, Type objType, IReflect objIReflect, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)

         at Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack)

         at MailMergeSchTask.modMailMergeSchTask.PDFToPS()

       

      Exception in PDFToPS method : The remote procedure call failed.

       

      code snippet

                  AcroApp = CType(CreateObject("AcroExch.App"), Acrobat.AcroApp)
                  finalPDF = CreateObject("AcroExch.PDDoc")
                  For Each fs As FileInfo In pdfDir(0).GetFiles
                              finalPDF.Open(fs.FullName)
                              outputFileName = "/s/Mailmerge/" + Path.GetFileNameWithoutExtension(fs.FullName) + ".ps"
                              js = finalPDF.GetJSObject()
                              pp = js.getPrintParams()
                              pp.fileName = outputFileName
                              pp.printerName = "HP Color LaserJet 5/5M PS"
                              Thread.Sleep(100)
                              js.print(pp)
                              Thread.Sleep(100)
                              finalPDF.Close()

                  Next

                  AcroApp.CloseAllDocs()
                  System.Runtime.InteropServices.Marshal.ReleaseComObject(finalPDF)
                  finalPDF = Nothing

         

       

      Thanks