4 Replies Latest reply on Jul 8, 2008 12:29 AM by (rchiu5hk)


      Dear all,

      I am using trial versions of adobe elements 6.0 and used in dot net
      development to convert excel document to pdf file format in
      the IIS Server.

      I have vb.net program which export excel to pdf format.
      I am using acrobat distiller but find the problem in the below statement.

      dim ddt as new ACRODISTXLib.PdfDistiller
      ddt.filetopdf("tempfilename.tmp", "C:\PDF", "")

      In first time, it works but when run again, it cannot convert to pdf.
      Do you know WHY?
      How Can I Do?
      New discovery as below:
      In my windows xp prof, when I run with visual studio 2005 debug mode, it
      works perfectly.

      But in Production windows server 2003 , it always need to close the browser
      and wait for certain time for next processing.

      Is it related to the IIS Session timeout problem as I guess??

      What is your opinions?
      ------------------------------------------------------------------------------------------ -----------
      Dim tempfilename As String = Page.MapPath("..\out\" & sFileName.Substring(0, sFileName.Length - 4) & ".tmp")

      Dim edo As New Excel.Application
      Dim edoc As Excel.Workbook
      Dim ddt As ACRODISTXLib.PdfDistiller

      edoc = edo.Workbooks.Open(Page.MapPath("..\out\" & sFileName))

      Dim sPrevPrinter As String

      sPrevPrinter = edo.ActivePrinter

      edo.ActiveWorkbook.PrintOut(, , , , , True, , tempfilename)


      edoc = Nothing
      edo = Nothing

      If ddt Is Nothing Then
      ddt = New ACRODISTXLib.PdfDistiller
      ddt.bSpoolJobs = True
      End If

      Label4.Text = ""
      Dim pdfstatus As Short = ddt.FileToPDF(tempfilename, Page.MapPath("..\out\"), "")

      ddt = Nothing

      Catch ex As Exception
      Dim err As String
      err = ex.ToString()
      ddt = Nothing

      End Try
      ------------------------------------------------------------------------------------------ --------------------------