COM Schnittstelle funktioniert nicht

Hallo Community,
nachdem ich den PDFCreator von Version 4.0.4 auf 4.1.0 geupdatet habe, wird der Treiber dieser Software nicht mehr gefunden. Den PDFCreators rufe ich über die COM Schnittstelle über ein selbst geschriebenen Programm auf. Die PdfCreatorComID ist dabei "PDFCreator.PDFCreatorObj" und der Druckertreibername ist "PDFCreator".

[EDIT]
Die nötigen COM Objekte sind bereits erfolgreich installiert worden. Diese habe ich über das Command

`gci HKLM:\Software\Classes -ea 0| ? {$_.PSChildName -match '^PDF\w+\.\w+$' -and (gp "$($_.PSPath)\CLSID" -ea 0)} | ft PSChildName`

bekommen. Als Ergebnis bekomme ich

  • PDFCreator.JobQueue
  • PDFCreator.PDFCreatorObj
  • PDFPrevHndlr.PDFPreviewHandler

Bei der Funktion CreateOleObject bekomme ich jedoch immer den Fehler: OLE-Fehler 80131500.

[EDIT 2]
Ich habe nun folgendes PowerShell-Script ausgeführt

try {
$app = New-Object -ComObject PDFCreator.PDFCreatorObj;
echo $app;
}
catch {
    $e = $_.Exception
    $msg = $e.Message
    while ($e.InnerException) {
      $e = $e.InnerException
      $msg += "`n" + $e.Message
    }
    $msg
}

und bekomme als Ergebnis:

#New-Object -ComObject pd
Ein Aufrufziel hat einen Ausnahmefehler verursacht.
No registration for type ComDependencies could be found and an implicit registration could not be made. No registration for type PdfCreatorAdapter could be found and an implicit registration
could not be made. Die Datei oder Assembly "System.Security.AccessControl, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" oder eine Abhängigkeit davon wurde nicht gefunden
. Das System kann die angegebene Datei nicht finden.
No registration for type PdfCreatorAdapter could be found and an implicit registration could not be made. Die Datei oder Assembly "System.Security.AccessControl, Version=4.1.1.0, Culture=neut
ral, PublicKeyToken=b03f5f7f11d50a3a" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.
Die Datei oder Assembly "System.Security.AccessControl, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann d
ie angegebene Datei nicht finden.
Die Datei oder Assembly "System.Security.AccessControl, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann d
ie angegebene Datei nicht finden.

Nun habe ich die Frage, ob an meinem Programm etwas falsch ist oder ob die Installation des neuen PDFCreators fehlerhaft ist.

Gruß,
Yannic

2 Likes

Seit dem Wechsel auf Version 4.1.0 funktioniert
Set pdfCreatorApp = CreateObject( "PDFCreator.PDFCreatorObj" )
bei mir auch nicht mehr. Ich habe das auf 2 Rechnern getestet. Bis zur Version 4.0.x hat das einwandfrei geklappt. Laut Dokumentation sollte das jedoch funktionieren. Die Installation von 4.1.0 hat keinen Fehler angezeigt, daher vermuten ich den Fehler in der Version 4.1.0. Hoffen wir auf eine baldige Fehlerkorrektur. Ich nutze diese Funktion sehr intensiv und der Fehler bedeutet für mich einen erheblich manuellen Mehraufwand.

1 Like

Auch in der neuen Version (4.1.1) funktionieren VBA-Macros nicht.

1 Like

Hallo zusammen,

das Problem wurde bereits mit Version 4.1.2 gefixt. Entschuldigt bitte vielmals die damit verbundenen Unannehmlichkeiten:
https://download.pdfforge.org/download/

Der Blog Post steht noch aus.

Freundliche Grüße
Sascha

Mit der Version 4.1.2 funktionieren die VBA-Makros bei mir wieder.
:smiley:
Vielen Dank an das Team und ein schönes Wochenende!

Wer die COM Schnitstelle benötigt:
Vers. 4.1.2 installieren oder bei 4.0.4 bleiben

don't know but for me 4.0.4 work but other new version does't...now I am testing latest 4.1.3.2..still this problem.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> SimpleInjector.ActivationException: No registration for type ComDependencies could be found and an implicit registration could not be made. No registration for type PdfCreatorAdapter could be found and an implicit registration could not be made. Could not load file or assembly 'System.Security.AccessControl, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) ---> SimpleInjector.ActivationException: No registration for type PdfCreatorAdapter could be found and an implicit registration could not be made. Could not load file or assembly 'System.Security.AccessControl, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) ---> SimpleInjector.ActivationException: Could not load file or assembly 'System.Security.AccessControl, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) ---> System.IO.FileLoadException: Could not load file or assembly 'System.Security.AccessControl, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) ---> System.IO.FileLoadException: The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
--- End of inner exception stack trace ---
at pdfforge.PDFCreator.Core.Printing.Port.PrinterPortReader.ReadPrinterPort(String portName)
at pdfforge.PDFCreator.Core.Printing.FolderProvider.ReadTempFolderName()
at pdfforge.PDFCreator.Core.Printing.FolderProvider.GetTempFolderBase()
at pdfforge.PDFCreator.Core.Printing.FolderProvider..ctor(IPrinterPortReader printerPortReader, IPath path)
at lambda_method(Closure )
at SimpleInjector.Lifestyles.SingletonLifestyle.SingletonLifestyleRegistration1.CreateInstance(Func1 instanceCreator)
at SimpleInjector.Lifestyles.SingletonLifestyle.SingletonLifestyleRegistration1.CreateInstanceWithNullCheck() at SimpleInjector.Lifestyles.SingletonLifestyle.SingletonLifestyleRegistration1.GetInterceptedInstance()
at SimpleInjector.Lifestyles.SingletonLifestyle.SingletonLifestyleRegistration1.BuildExpression() at SimpleInjector.InstanceProducer.BuildExpressionInternal() at SimpleInjector.Internals.LazyEx1.get_Value()
at SimpleInjector.InstanceProducer.BuildExpression()
--- End of inner exception stack trace ---
at SimpleInjector.InstanceProducer.BuildExpression()
at SimpleInjector.Registration.BuildConstructorParameters(ConstructorInfo constructor)
at SimpleInjector.Registration.BuildNewExpression()
at SimpleInjector.Registration.BuildTransientExpression()
at SimpleInjector.InstanceProducer.BuildExpressionInternal()
at SimpleInjector.Internals.LazyEx1.get_Value() at SimpleInjector.InstanceProducer.BuildExpression() at SimpleInjector.Registration.BuildConstructorParameters(ConstructorInfo constructor) at SimpleInjector.Registration.BuildNewExpression() at SimpleInjector.Registration.BuildTransientExpression() at SimpleInjector.InstanceProducer.BuildExpressionInternal() at SimpleInjector.Internals.LazyEx1.get_Value()
at SimpleInjector.InstanceProducer.BuildExpression()
--- End of inner exception stack trace ---
at SimpleInjector.InstanceProducer.BuildExpression()
at SimpleInjector.Registration.BuildConstructorParameters(ConstructorInfo constructor)
at SimpleInjector.Registration.BuildNewExpression()
at SimpleInjector.Registration.BuildTransientExpression()
at SimpleInjector.InstanceProducer.BuildExpressionInternal()
at SimpleInjector.Internals.LazyEx`1.get_Value()
at SimpleInjector.InstanceProducer.BuildInstanceCreator()
at SimpleInjector.InstanceProducer.BuildAndReplaceInstanceCreatorAndCreateFirstInstance()
at SimpleInjector.InstanceProducer.GetInstance()
--- End of inner exception stack trace ---
at SimpleInjector.InstanceProducer.GetInstance()
at SimpleInjector.Container.GetInstanceForRootTypeTService
at SimpleInjector.Container.GetInstanceTService
at pdfforge.PDFCreator.UI.COM.ComDependencyBuilder.BuildComDependencies()
at pdfforge.PDFCreator.UI.COM.ComDependencyBuilder.get_ComDependencies()
at pdfforge.PDFCreator.UI.COM.Queue..ctor()
--- End of inner exception stack trace ---
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)