Opening Adobe reader for every document printing

I still have an issue with Adobe Reader opening as a blank application, and needing to be closed in order for the PDF creation to proceed.  It opens and needs to be closed for every file I'm combining; if I am combining 5 files, adobe Reader opens 5 times (and needs to be closed before the next of the 5 documents is processed).

The VBA script I'm using is below (I'm making several Excel sheets into PDF's, then including other PDFs into the PDF I created with the Excel sheets).

If no one can help me with this, can someone just tell me the .coption name to set the "After Autosaving open the document with the default program" to no?  This is the only thing I can think of that might be causing this to happen.

Code:

Set pdfjob = New PDFCreator.clsPDFCreator

'Make sure the PDF printer can start
If pdfjob.cStart("/NoProcessingAtStartup") = False Then
    MsgBox "Can't initialize PDFCreator.", vbCritical + _
            vbOKOnly, "Error!"
    Exit Sub
End If

'Set defaults
With pdfjob
    .cOption("UseAutosave") = 1
    .cOption("UseAutosaveDirectory") = 1
    .cOption("AutosaveDirectory") = sPDFPath
    .cOption("AutosaveFilename") = sPDFName
    .cOption("AutosaveFormat") = 0    ' 0 = PDF
    .cClearCache
'Get Windows' current default printer to set back later
    DefaultPrinter = .cDefaultPrinter
    .cDefaultPrinter = "PDFCreator"
End With

'Make sheets into PDF's
Application.Sheets("Cover").PrintOut copies:=1, ActivePrinter:="PDFCreator"
Application.Sheets("Report").PrintOut copies:=1, ActivePrinter:="PDFCreator"
Application.Sheets("Raw").PrintOut copies:=1, ActivePrinter:="PDFCreator"
Application.Sheets("Final").PrintOut copies:=1, ActivePrinter:="PDFCreator"

'Include chosen PDF files in new PDF
For i = LBound(PDFList) To UBound(PDFList)
    pdfjob.cPrintFile (PDFList(i))
Next i

'Wait until all print jobs have entered the print queue
Do Until pdfjob.cCountOfPrintjobs = 5 + UBound(PDFList) + 1
    DoEvents
Loop

'Combine all PDFs into a single file and stop the printer
With pdfjob
    .cCombineAll
    .cPrinterStop = False
End With

'Wait until PDF creator is finished then release the objects
    Do Until pdfjob.cCountOfPrintjobs = 0
        DoEvents
    Loop
'above wait wasn't long enough, pdf not getting created; added 2-second delay
Application.Wait Now + TimeValue("00:00:02")

'reset original Windows' default printer
pdfjob.cDefaultPrinter = DefaultPrinter
pdfjob.cClose
Set pdfjob = Nothing

'Reset aplication's original default printer in case different
Application.ActivePrinter = DefPrntr
 

It's not PDFCreator problem, it's Acrobat related problem!

The same problem I've noticed trying to print multiple .docs from explorer:

- selected 5 documents

- right-clicked and Print

First document comes out of printer and then I have to close Acrobat Reader to proceed next doc.

 

I can't fix the problem too.

I try:

OleObject objPdfCreator, objPdfCreatorOptions

objPdfCreator.ConnectToNewObject("PDFCreator.clsPDFCreator")
objPdfCreatorOptions = objPdfCreator.cOptions

...

objPdfCreatorOptions.AutosaveStartStandardProgram = 0
objPdfCreatorOptions.RunProgramAfterSaving = 0
objPdfCreatorOptions.RunProgramBeforeSaving = 0
objPdfCreatorOptions.StartStandardProgram = 0
...

But the Acrobat Reader start always.  If I change the default program for the PDF files to other than Adobe Reader, then the pool of PDFCreator doesn't works.

 

 

I have the same problem.

Even if you try the C# example app and use a PDF as input. Seem like a bug to me.

Hi,
I have a similar problem. When I try to print a PDF file to TIFF with the function cPrint, PDFCreator open adobe reader and does not go forward until I close Adobe Reader. My system is Windows 7 Ultimate x64 - PDFCreator 1.2.1 - Adobe reader 10.0.1.
Any response is greatly appreciated.

I also tested the 9.3.0 version of adobe reader, but does not work

Yes, with me it opens Adobe Acrobat.

I have this same problem with cPrintFile using PDF document from Access 2003 - has anybody found a solution to this yet?

Using latest version 1.2.3 same problem with 1.2.2 - am I mising something?

Using Adobe 9.4.6

 Same problem for me,

Adobe reader stay open and the VB program is blocked. After closing reader, VB program continue.

Please staff, have a look of our problem.

 I have solved the problem using Foxit Reader instead of Adobe Reader.

Everything works fine now and I can create a signed PDF based on a non-signed PDF without any window.

More information at foxitsoftware.com/Secure_PDF_Reader/ (free)

Bye

 Please some help

Hi,
I was wrong. I thought that the problem was solved after a few hours on Friday and when I tried on Monday, it was there again.
It not only happens with PDF files. If you try to print txt files is the notepad, if xls is Excel …
The result is the same as when you use the Windows API function ShellExecute with the difference that cPrintFile opens so many instances as files and stops de execution. No way.
My solution has been to use ShellExecute with ‘print’ option instead cPrintFile. It opens the program only one time and the process keeps running. I kill acrobat at the end.
I use a similar code as the first message

'First an Access Report
DoCmd.OpenReport “rptFiltroDoc”

For i = LBound(PDFList) To UBound(PDFList)
’ — ERASED LINE pdfjob.cPrintFile (PDFList(i))
ShellExecute(0&, “print”, PDFList(i)), 0&, vbNullString, SW_HIDE)
Next i

Then all the files are in the PFDcreator queue and I can combine them.
It’s only an idea.

 Using  cPrintFile ?

Hello,

The code works in my case if I uncheck the option of opening the application after printing in the window that you can see when printing a document from Word, Excel... using PDFCreator and where you put the name and the path to save the PDF.

 

 

 

 

 You can try with Foxit Reader. I have no problem with

Hi,

please take a look at the new FAQ entry

http://www.pdfforge.org/content/adobe-reader-stays-open-when-script-used-combine-pdfs

 

I would say the faq does not solve the problem. In fact the problem is when you print a PDF using the function. CPrintFile.

Hi,

if you want to merge PDFs, you don´t need CPrintFile, but can use the MergePDFFiles function instead.
Or do you need to use CPrintFile for something else?

 

I have same problem as all above. The reason I am using cprintfile is I cant access MergePDFFiles function from VBA. Can this be done and if so how?

Dear,

I have the same problem, but for people who just want to print more files without any script here is a little workaround:

 

1) setup auto-saving properties as you prefer in PDFCreator

2) drag and drop files directly in the printer, listed under Devices and Printer or Printer and fax (depending from your system)

3) PDFCreator will open and start saving your files as you setup (acrobat reader opens but without blocking the process) If the print doesn't start automatically check if you have stopped the printer in PDFCreator (icon top left)

 

Hope this helps.

Greetings