Link to home
Start Free TrialLog in
Avatar of AndrewBanfer
AndrewBanfer

asked on

How can I merge to PDF Files in VB6 using PDFCreator COM

How can I merge to PDF Files in VB6 using PDFCreator COM?

Here is the code I'm using.  PDFCreator prints files to a PDF so the second file overwrites the first and doesn't combine.  Is there a "Wait" I should put in to pause it in the printer spooler to combine?
With opt
           .AutosaveDirectory = exportpath$ & "\"
           .AutosaveFilename = "ALLSAM.pdf"
           .AutosaveFormat = 0 ' PDF
           .UseAutosave = 1
           .UseAutosaveDirectory = 1
           .AutosaveStartStandardProgram = 0
         
 End With
 Set PDFCreator1.cOptions = opt
 
 Set Printer = Printers(PrinterIndex("PDFCreator"))
        With Printer
            File1 = "C:\data\SAM1.pdf"
            File2 = "C:\data\SAM2.pdf"
            PDFCreator1.cPrintFile (File1)
            PDFCreator1.cPrintFile (File2)
            PDFCreator1.cCombineAll
        End With
        PDFCreator1.cPrinterStop = False

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AndrewBanfer
AndrewBanfer

ASKER

Thanks very much!  Very helpful!  

Have a great day!