Results 1 to 2 of 2
  1. #1
    PeteSimpson
    Guest

    Documents to PDF

    I noticed an earlier post where someone was having printer problems after using the Acrobat printer driver as the ActivePrinter. Others suggested using the PDFMaker template.

    Why not set a reference to the Acrobat Distiller library. Create a class module. I called it cDistiller:

    Public WithEvents oDist As PdfDistiller

    Private Sub Class_Initialize()
    Set oDist = New PdfDistiller
    End Sub

    And in a standard module:
    Sub MAIN()
    'Construct the Postscript file name. Here I use a function using the old Word Basic FileNameInfo. Old habits die hard.
    strPSfilename = strFileNameInfo(ActiveDocument.Name, 5) _
    & strFileNameInfo(ActiveDocument.Name, 4) & ".ps"

    'PrintToFile will save as Postscript format
    ActiveDocument.PrintOut Copies:=1, OutputFileName:=strPSfilename, PrintToFile:=True

    ' Create PDF using Distiller
    PDFaFile strPSfilename, "", ""
    End Sub

    Sub PDFaFile(sInputPS, sOutputPDF, sJobOptions)
    ' Produce a PDF document
    Dim oPDFDist As cDistiller
    Set oPDFDist = New cDistiller
    Call oPDFDist.oDist.FileToPDF(sInputPS, sOutputPDF, sJobOptions)
    End Sub

    The Acrobat Distiller library gives you fine control over the process of creating PDFs.

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Documents to PDF

    Pete, thanks for this. Saved my bacon!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •