convert any text file into pdf file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • progvar
    New Member
    • Feb 2008
    • 40

    convert any text file into pdf file

    Hi!
    can any one help me by providing the method when i open any text file and convert into pdf format. I searched on the net and i got some code but i am not understanding this code and it also produce error on the highlited line. for converting the file can i have to do the refrence to adobe liberary please tell me

    Dim wrd As New Word.Applicatio n
    Dim doc As Word.Document
    wrd.Visible = False
    wrd.ScreenUpdat ing = False
    wrd.ActivePrint er = "Acrobat Distiller"
    'Open the document
    Set doc = wrd.Documents.O pen("d:\abc\tes t.doc")
    'Print it to a PostScript file using Distiller
    doc.PrintOut False, False, , "d:\abc\test.ps ", , , , , , , True
    doc.Close False
    wrd.Quit False
    Set doc = Nothing
    Set wrd = Nothing
    'Now call distiller to convert the postscript file to PDF
    Dim acr As New ACRODISTXLib.Pd fDistiller//user defined type not defined
    acr.bShowWindow = False
    acr.FileToPDF "d:\abc\test.ps ", "d:\abc\test.pd f", True
    'acr.FileToPDF "d:\abc\test.ps ", "d:\abc\test.pd f", 1
    Set acr = Nothing
    'Delete the old PS file
    Kill "d:\abc\test.ps "
    'Done

    Exit Sub
    PDF_error:
    doc.Close False
    wrd.Quit False
    Set doc = Nothing
    Set wrd = Nothing
    Set acr = Nothing
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Do you have the third party component / DLL in your system and is that referenced to your project ?

    Comment

    • progvar
      New Member
      • Feb 2008
      • 40

      #3
      i don't have DLL in my systems related to this program


      Originally posted by debasisdas
      Do you have the third party component / DLL in your system and is that referenced to your project ?

      Comment

      Working...