Replies: 6 comments
|
Well, I'm answering my own question, it may help someone else. I found out what the issue was and was able to make it work. Here's the details. First thing I did was testing the other iText libs: import clr
clr.AddReference('itext.forms')
from iText.Forms import PdfAcroFormThis worked flawlessy, so the issue must've been in I tried using older builds, and I found out that build 7.0.8 worked fine. I compared it with build 7.1.11 (the one I was having problems with) using dotPeek, and noticed it has some references, namely I did put them in the project folder, but still no dice... until I noticed I was using Basically the newer builds of iText7 have 3 referenced libs, that must be present in the exact same version. THE QUESTION Would it be possible for pythonnet to be more verbose about this? The I'm just asking, I don't know if it's feasible. Also, thanks a lot for pythonnet! Just found it and already find it useful. |
|
Thank you, I met however, for itext7.7.2.0, even |
|
correct: for iText7 7.2.2.0 you need Microsoft.Extensions.Logging.Abstractions.dll (v5.0.0), since the Microsoft.Extensions.Logging framework was introduced as the new iText code logging module This change adds the need for Microsoft.Extensions.Logging.dll and Microsoft.Extensions.Options.dll too, as you can see by some use of dotPeek on itext.commons.dll and the error messages. Add those 2 and it should run just fine (at least my code does). |
|
now it works, thank you. I forgot to check |
|
You can select "Inspect", "Reference Hierarchy" and see the whole tree of dependencies referenced. Or you could try ILSpy (7.2 Preview 3) which shows all references of a dll, recursively, not just the top level ones, in the first tree - seems faster to me that dotPeek, may be a viable alternative. |
|
the commandline tool asmspy can show the dependencies. the red text means something is wrong. However, it also displays redundant missing |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Environment
Details
I'm using Python.NET to create small wrapper for iText (https://github.com/itext/itext7-dotnet).
With Jetbrain dotPeek I see that itext.kernel (the dll I'm trying to use) has various namespaces; the namespace iText.Kernel.Pdf is what I need, in particular the public class PdfReader is what I want to use.
Here's what I'm doing:
But the last line gets me a:
I am able to load other dlls and use them just fine, but I don't get what is wrong here.
Can someone please point me to the right direction? Thanks.
edit: I can import and use iTextSharp just fine (different namespaces / classes), it seems iText7 has something different.
All reactions