Skip to content

Issue importing iText .net lib using pythonnet #1182

Description

@typhoon71

Environment

  • Pythonnet version: 2.5.1
  • Python version: 3.7
  • Operating System: Windows7
  • iText version 7.1.11.0 (dotnet4)

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:

import clr
clr.AddReference('itext.kernel')
sys.path.append(os.getcwd())  # the script is currently in the dll folder
from iText.Kernel.Pdf import PdfReader

But the last line gets me a:

 "ModuleNotFoundError: No module named 'iText'" error.

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions