ComObject "Could not find the method 'Initialize'"

Hi,

I have been automating the creation of PDF files using The com interface and Windows PowerShell. It worked super well on machines that had PowerShell version 3 and above, AND with computers that had an internet connection.

I have two questions:

  1. What is the minimal version needed of PowerShell for the com interface to work properly?
  2. I have an error message when I install pdf creator on a Windows Server 2008 Box that does NOT have access to the internet. It tries to connect to the internet to download and install additional files apperently, even though I have downloaded a full version of the PDFCreator installer. It is possible to by pass this (choosing not to install these additional files) and continue the installation anyway. What is the repercution of this choice? what is he trying to download?

When I skip that download part, and execute my code I have the following error message: “Could not find the method ‘Initialize’”.

It seems like the additional download adds this method to the basic dll. would that possible? or could I have this error message simply because it was ran on Powershell 2.0 box?

Thanks for your fast answer! :slight_smile:
Stéphane

Hi Stephane,

I am afraid I don’t know the answer to those questions. There is nothing PDFCreator needs to download, so my guess is Powershell/Windows is attempting to download some files it needs to work . You could use Fiddler or something similar to see the request for the download.

Best regards,

Robin

Hi Robin,

Too bad you are not able to answer my questions, but thanks for your answer anyways.

I actually found the answer to my questions my self, and bloged about it on my blog. Unfortunatley, It seems like I am not allowed to put a link into my posts here since i am “a new user, and new users are not allowed to post links”.

Is there a way for me to share my work with the rest of the community. I am pretty sure I am not the only one which had these questions.

Hi Stephane,

I have raised your trust level so you should now be able to post links.
Sorry for the trouble, unfortunatley without very strict settings we get tons of spam.

Best regards,

Robin

Thank you Robin :slight_smile:

As I was mentionning above, I have been automating PDFCreator with Windows PowerShell.

For the people that are interested, I have written two blog articles that explains how the pdfCreator com object works in order to automate pdf printing using PowerShell, and a second article with a more concrete example on how you can print to PDF internet explorer web pages. (See the links here under)

  1. How to Automate PDFCreator using Windows PowerShell -> http://powershelldistrict.com/pdfcreator-powershell/

  2. An example on how to automate the printing to PDF of internet explorer web pages using Powershell -> http://powershelldistrict.com/print-webpage-pdf-powershell/

I hope this will be usefull to somebody.

@Robin.W: Should I post this somwhere else as well to make it better available to people wanting to automate PDFCreator using Windows PowerShell?

Stéphane

Thanks for sharing, I think it is in a good place here, if I see anybody else asking for this I will send them here.

Best regards,

Robin