0

I seem to be going in circles trying to add the itextpdf libraries to my Eclipse. It seems that itext is available via github but I don't see the jar files for including in Eclipse as external libraries. On the other hand, it looks like it is available via the Maven repositories but with much searching, I cannot figure out how to include them in Eclipse. All I can find are instructions that involve editing pom.xml and/or settings.xml. Surely it is not really that complicated.

So my question is what do I use in the install new software panel as the site for itext or maven? Alternatively, where can I find the itext jar files to download? TIA.

Wt Riker
  • 514
  • 12
  • 24

2 Answers2

12

The iText source code is managed in Github. You can download the iText 7 binaries (the .jar files) in the .zip files in the releases page or the developer's page. There is a Community (opensource) version you can download freely.


If you are using Eclipse, I recommend you create a Maven project and add the dependency. There are some instructions at the installation page:

  • Create a Maven project, using File > New > Project ... > Maven Project
  • In the wizard, select Create a simple projectto skip the selection of an archetype, define a Group Id and an Artifact Id and click on Finish.
  • Add the iText dependency to the project using the wizard, or editing the pom.xml file.

After you define the dependency, Eclipse/Maven will download the dependencies (the .jar files).


If you edit the pom.xml you must add the iText dependency. The installation page mentions that you can add all the Community packages using the following snippet:

<!-- add all iText 7 Community modules -->
<dependency>
    <groupId>com.itextpdf</groupId>
    <artifactId>itext7-core</artifactId>
    <version>7.0.4</version>
    <type>pom</type>
</dependency>
Jaime
  • 5,435
  • 2
  • 18
  • 21
  • 2
    Thanks for the reply. I already have a project but now want to start adding reporting to it using itext. Can I add Maven to the existing project or am I creating a new project just to get the Maven repositories into Eclipse that can be used anywhere? P.S. I have a dozen pom.xml files so how do I know which one to use? – Wt Riker Oct 19 '17 at 15:46
  • If your project does not use Maven, you may create one based on your source code. -- Eclipse has a wizard that may help you. You can right click on your project and select `Configure > Convert to Maven Project`. You must answer some questions there. -- It may convert simple project. Complex projects may require more work, – Jaime Oct 19 '17 at 16:06
  • I guess my Eclipse installation is missing something. I do no have that menu item under configure. I have 4 other conversion options but not that one. – Wt Riker Oct 19 '17 at 17:08
  • Ummm... That depends on the plugins you have installed. I Just checked in my (old) Eclipse Neon (installed without many plugins) and the menu exists there. -- Try to install the m2e extension/plugins in your Eclipse. – Jaime Oct 19 '17 at 17:15
  • I'll give that a try. Thanks. FWIW, my Eclipse is Mars 2. – Wt Riker Oct 19 '17 at 18:06
  • Probably, this may be an opportunity to upgrade your Eclipse :) -- I just tested in the most recent Eclipse Oxygen 1a, and the menu is there. – Jaime Oct 19 '17 at 18:13
  • I got it. I first installed m2e which gave me the maven conversion option. However, when done I still had no itextpdf. So I upgraded to Oxygen.1A which didn't really do much to help. However, I found an article that showed I needed to rebuild the index with the maven repositories. Then I was able to add the itext dependency. None of this went through the normal install software wizard. Seems like a flaw in the process to me. Thanks for all the help. – Wt Riker Oct 20 '17 at 14:49
  • Sorry. I did not mention it. -- Every time you manually change the `pom.xml` to change versions or include new dependencies, or when you checkout the project (e.g. from Github), you must right click the project and execute `Maven > Update project...` to download and update the libraries. – Jaime Oct 20 '17 at 15:16
0

Late answer but I found the Artifactory repo here: https://repo.itextsupport.com/webapp/#/search/quick/eyJzZWFyY2giOiJxdWljayIsInF1ZXJ5IjoiY29tLml0ZXh0cGRmLnBkZmRlYnVnLnNpdGUtMi4wLjEuemlwIn0= I extracted the repo location and exact search term from the Eclipse Marketplace URL, which would not download because of the sun.security.validator.ValidatorException problem. But I could download the zip file and installed in Eclipse- do: Help | Install New... | Add... | Archive... -- then navigate to the zip download and it will install that way.