I realized that I was trying to use an unsupported method - I was trying to enque non postscript files, pushing them directly to the PDFCreator queue. Instead, I have a working solution by using Acrobat Reader to "print" to the PDFCreator printer; this provides the postscript file that PDFCreator expects and it queues the job. Here's some code snippets that work for my implementation:
Public Sub PDFCreatorPrint(vFromPaths As Variant, fullPath As String, Optional vAddBlankPage As Boolean, Optional vPageCount As Long)
Dim PDFCreatorQueue As Variant
Dim printJob As Variant
Set PDFCreatorQueue = CreateObject("PDFCreator.JobQueue")
On Error GoTo Err_exit
Set printJob = CreateObject("PDFCreator.PdfCreatorObj")
On Error GoTo Err_exit
If Not isPDFCreatorRunning Then
PDFCreatorQueue.Initialize
Else
Set PDFCreatorQueue = Nothing
Set printJob = Nothing
Exit Sub
End If
...
SetApplicationPrinter "PDFCreator" 'custom procedure to set Application.Printer
...
'timing parameters
Dim dTime As Date, T As Integer, beg As Integer, n As Date, pdfOutput
n = Now
T = 30
beg = 0
'Queue the documents contained in vPath
Dim jobCount As Integer, vPath, strExecutable As String
jobCount = 0
For Each vPath In Split(CStr(vFromPaths), ",")
If Dir(CStr(vPath)) <> "" Then 'file exists
If getAdobeReaderPath And gAcroRd32 <> "" Then 'Acrobat Reader is installed and recognized
strExecutable = Chr$(34) & gAcroRd32 & Chr$(34) & " /N /H /T "
strExecutable = strExecutable & Chr$(34) & vPath & Chr$(34)
strExecutable = strExecutable & " " & Chr$(34) & Application.Printer.DeviceName & Chr$(34)
Shell strExecutable, vbHide 'use Acrobat Reader to "print" to the PDFCreator printer, i.e., queue each document
DoCmd.Hourglass True
dTime = DateAdd("s", T, Now)
jobCount = jobCount + 1
Do Until PDFCreatorQueue.Count = jobCount Or Now > dTime 'wait
'iterate
beg = beg * 0
Loop
DoCmd.Hourglass False
'check if file made it into the queue
If PDFCreatorQueue.Count < jobCount Then
MsgBox "PDFCreator - unable to add the file [" & vPath & "] to the queue.", vbOKOnly, "PDFCreator"
End If
End If
Else
MsgBoxCall "Unable to locate " & vPath & " - file does not exist.", vbOKOnly, "PDFCreator"
End If
Next vPath
dTime = DateAdd("s", 60, Now)
T = 7
beg = 0
Do Until PDFCreatorQueue.Count = jobCount Or Now > dTime 'wait
If Not PDFCreatorQueue.WaitForJobs(jobCount, T) Then
'iterate
beg = beg + T
End If
Loop
If PDFCreatorQueue.Count > 0 Then
PDFCreatorQueue.MergeAllJobs
Set printJob = PDFCreatorQueue.NextJob
printJob.SetProfileSetting "OpenViewer", "False"
printJob.ConvertTo (fullPath) 'produce the final merged PDF doc
If (Not printJob.IsFinished Or Not printJob.IsSuccessful) Then
MsgBox "PDFCreator - Could not convert the file: " & fullPath, vbOKOnly, "PDFCreator"
End If
End If
On Error GoTo 0
Err_exit:
If Err.Number <> 0 Then
MsgBox "Could not create the file at " & fullPath & ". An error occurred while printing to the PDFCreator printer " & Application.Printer.DeviceName & ". Error " & Err.Number & " - " & Err.Description, vbOKOnly, "PDFCreator Error"
End If
PDFCreatorQueue.ReleaseCom
Set PDFCreatorQueue = Nothing
Set printJob = Nothing
...
Blockquote