"-2147417848 Automation error" merging and saving PDFs

The PDF Creator enables you to create secure PDF documents and to view, print and process existing PDF documents.
If you have any questions about the installation and usage of the PDF Creator please post them here.
Post Reply
Posts: 5
Joined: Wed Feb 20 2008

"-2147417848 Automation error" merging and saving PDFs

Post by oscarand » Fri Jun 20 2008

I'm using Amyuni PDF Creator 3.0 to add backgrounds to my PDFs. I do this by using an executable with the cycle in the bottom and in some (random) cases I get the "-2147417848 Automation error. The object invoked has disconnected from its clients".
My executable can be runned at the same time (on the same machine) with other programs that use Amynuni for merging and saving PDFs files: I noted this type of concurrency can causes this kind of problems of cdintf300.dll library...is it true?
Can you suggest me about a workaround to avoid "-2147417848 Automation error"?
Thank you.

For i = 0 To iMaxIndex
sPDFFile = GetPdfFilePath(i) 'Return i° PDF file path

If FileExists(sPDFFile) Then
sNewPDFFile = GetNewPdfFilePath(i) 'Return i° new PDF file path
'Add background to my PDF
Set cdiDoc = New CDIntfEx.Document
cdiDoc.Open sPDFFile
cdiDoc.Merge App.Path & "\MyBackground.pdf", 2
'Save the result PDF into new PDF file path
cdiDoc.Save sNewPDFFile
Set cdiDoc = Nothing
End If
Next i

Amyuni Team
Posts: 551
Joined: Tue Oct 01 2002

Re: "-2147417848 Automation error" merging and saving PDFs

Post by Jose » Fri Jun 20 2008


The "-2147417848 Automation error" message typically gets generated when CDIntf can not open a PDF document. Can you verify if this is the case?

Get PDF Suite, the expert .NET developer toolkit for PDF conversion, creation and editing - www.amyuni.com/pdfsuite

Posts: 5
Joined: Wed Feb 20 2008

Re: "-2147417848 Automation error" merging and saving PDFs

Post by oscarand » Fri Jun 20 2008

MyBackground.pdf file is a file installed with the application, so it is always present and it never changes: so if the Amyuni can open it at the "i-1"° step, it must opened at the i° step too.
Instead, the sources PDF files (in my sPDFFile variable) are in the file system of course, because the function "FileExists(sPDFFile)" exited with True.

It is possible, when the functions "cdiDoc.Merge" and "cdiDoc.Save" returned the control to the program, the PDF files are not yet merged/saved totally? So the next loop will begin to merge and save the next PDF before the previous is finished.

I don't know if it is important, but while the executable run, another executable is running opening the same PDFs with PDFCreativeX component for preview: what happens if at the same time PDFCreativeX open "foo.pdf" for preview, and my executable open it for merge "foo.pdf" into "foo2.pdf"? This can be a problem? In this case, can be a workaround to retry the operation until Amyuni can open the PDF without automation error?

Post Reply