Core Java Library + PDF/A, xtra and XML Worker

Related tags

PDF itextpdf
Overview

PLEASE NOTE: iText 5 is EOL, and has been replaced by iText 7. Only security fixes will be added

Known Security Issues

org.apache.santuario:xmlsec vulnerabilities

The iText 5 targets Java 5 which means that we can not update org.apache.santuario:xmlsec version to 2.x.x or newer as it requires Java 8. If you are not using the com.itextpdf.text.pdf.security.MakeXmlSignature class then you can avoid adding org.apache.santuario:xmlsec dependency into your project. Which means that you would not be affected by the related vulnerabilities, for example https://snyk.io/vuln/SNYK-JAVA-ORGAPACHESANTUARIO-1655558. If you are using com.itextpdf.text.pdf.security.MakeXmlSignature class, for example for XFA signatures, then you can:

  • either use org.apache.santuario:xmlsec 1.5.8 as a dependency which is affected by the vulnerability specified above, but works on Java 5+;
  • or use org.apache.santuario:xmlsec 2.1.7 or newer. But this would require java 8+ and affects on the output format (see https://issues.apache.org/jira/browse/SANTUARIO-494).

We HIGHLY recommend customers use iText 7 for new projects, and to consider moving existing projects from iText 5 to iText 7 to benefit from the many improvements such as:

  • HTML to PDF (PDF/UA) conversion
  • PDF Redaction
  • SVG support
  • Better language support: Indic, Thai, Khmer, Arabic, Hebrew. (Close-source addon)
  • PDF Debugging for your IDE
  • Data Extraction
  • Better continued support and bugfixes
  • More modular, extensible handling of your document workflow
  • Extra practical add-ons
  • Encryption, hashing & digital signatures

iText 5 consists of several jars.

The main release contains:

  • itextpdf-x.y.z.jar: the core library
  • itext-xtra-x.y.z.jar: extra functionality (PDF 2!)
  • itext-pdfa-x.y.z.jar: PDF/A-related functionality
  • xmlworker-x.y.z.jar: XML (and HTML) functionality

iText 5 is hosted on https://github.com/itext/itextpdf

You can find the latest releases here:

You can also build iText 5 from source.

We also have RUPS — a tool that can help you debug PDFs. It's hosted on http://github.com/itext/rups

iText is licensed as AGPL software.

AGPL is a free / open source software license.

This doesn't mean the software is gratis!

Buying a license is mandatory as soon as you develop commercial activities distributing the iText software inside your product or deploying it on a network without disclosing the source code of your own applications under the AGPL license. These activities include:

  • offering paid services to customers as an ASP
  • serving PDFs on the fly in the cloud or in a web application
  • shipping iText with a closed source product

Contact sales for more info: http://itextpdf.com/sales

Comments
  • change PdfPageLabels.getPageLabels() to scope prefixes to the range

    change PdfPageLabels.getPageLabels() to scope prefixes to the range

    they are defined for

    While reading a PDF generated by Adobe InDesign CS6 using the Adobe PDF Library 10.0.1 which included several page label sections I noticed iText was keeping the prefix applied to subsequent sections in the values return by PdfPageLabels.getPageLabels(), even when the key was omitted in the following page label dictionary entries. According to the PDF Reference 1.7, Table 8.10 says that /P is an optional label prefix for page labels in this range. PDF Readers I have installed scope the prfix only to the range it is specified. This change empties out the prefix field to give behaviour I think aligns with the reference and my experience of other PDF readers. I also reformatted the function as previously it was a mix of tab & space indenting.

    I am not aware of any potential regression issues introduced by this change, existing page label dictionaries created by iText set /P to an empty string so this will only affect reading PDFs with partially prefixed page label ranges as far as I know.

    opened by Palmr 9
  • Some slightly malformed PDFs have PdfNull as AcroForm entry

    Some slightly malformed PDFs have PdfNull as AcroForm entry

    We were seeing ClassCastException on the return from PdfReader.getPdfObject() in PdfStamperImpl b/c PdfNull was being returned instead of null - best to not cast at that point and do an instanceof check later.

    opened by trumpetinc 7
  • Fix NPE when adding illegal child to nameless PdfLayer

    Fix NPE when adding illegal child to nameless PdfLayer

    When a PdfLayer is created without a name, e.g., via PdfLayer.createTitle() or when reading OCProperties, and later a child that has already another parent is added to this layer, the addChild(PdfLayer) method throws a NullPointerException. The is because the name is retrieved and immediately converted to a Unicode string, even if it is null.

    This problem was identified by our automated detector MUDetect. We would very much appreciate your feedback on our patch. Thank you very much!

    opened by salsolatragus 5
  • change CrlClientOnline to ignore content-type

    change CrlClientOnline to ignore content-type

    Using CrlClientOnline to fetch CRLs fails if the webserver publishing the CRL does not provide a content-type header in the response. Since the response is basically just converted to an input stream and is used in its raw format, the content type is not really needed. The case where I've seen this break is while fetching the CRL from Adobe CDS: http://crl.adobe.com/cds.crl

    opened by janflora 5
  • Printing more verbose information for the image in PDF.

    Printing more verbose information for the image in PDF.

    I use PdfContentReaderTool class to quickly look into PDF structure. Please consider the following patch that prints also meta-information for images in PDF.

    opened by dmak 5
  • Bug in BBox translation when flattening annotations

    Bug in BBox translation when flattening annotations

    Hi, I ran into a problem with flattening callout annotations done through Foxit. After being flattened into a PDF via PdfStamper, their position was somewhat "off". I'm not a PDF expert at all, but having dug into PdfStamperImp.flattenAnnotations(boolean) method, it is considering the BBox translation only for scale of the PDF Object, but not for its position. The attached pull request works for me and makes logical sense, but not an expert for PDFs.

    Thanks, Thomas

    opened by tbuckel 4
  • Master

    Master

    Hi,

    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/imaging/ImageFormats at com.itextpdf.text.pdf.pdfcleanup.PdfCleanUpRenderListener.processImage(PdfCleanUpRenderListener.java:316)

    The import class has typo mistake in PdfCleanUpRenderListener.java

    org/apache/commons/imaging/ImageFormats (Wrong) org/apache/commons/imaging/ImageFormat (Correct)

    Thanks,

    opened by Rampradeepb 4
  • added check marker for BDC when nested in block which is to be removed

    added check marker for BDC when nested in block which is to be removed

    I wanted to remove some components from my PDF. We arranged stuff in layers to be able to to so, but iText missed some parts when removing Optional Content. I drew an explanation for my case.

    1477330212

    I think the Parser is missing the BDC and therefore not incrementing the internal mc_balance variable, so when it gets to the EMC it stops rather than decrementing.

    I have tested this only with two different PDF files and its working. I cannot guarantee that this fix is completely right.

    opened by derlucas 4
  • Fixed DPI calculation for colored image in case when resolution unit is RESUNIT_NONE

    Fixed DPI calculation for colored image in case when resolution unit is RESUNIT_NONE

    I have noticed inconsistency in how DPI is calculated in case of colored TIFF image. In particluar, in TiffImage:146 that processed B&W image there is the code like this:

    dpiX = getDpi(dir.getField(TIFFConstants.TIFFTAG_XRESOLUTION), resolutionUnit);
    dpiY = getDpi(dir.getField(TIFFConstants.TIFFTAG_YRESOLUTION), resolutionUnit);
    if (resolutionUnit == TIFFConstants.RESUNIT_NONE) {
        if (dpiY != 0)
            XYRatio = (float)dpiX / (float)dpiY;
        dpiX = 0;
        dpiY = 0;
    }
    

    This code sets DPI to zero in case when resolutionUnit is RESUNIT_NONE (i.e. "undefined"). However that does not happen in TiffImage:392 which processes colored image. As the result DPI for colored image becomes 1 DPI, which is incorrect.

    The given patch just extracts the code that does DPI calculation as a separate function, eliminating code duplication.

    However there is one open question: B&W flow also sets X/Y ration (see TiffImage:273) while color flow does not. I can add that line also to color flow, but I would like for somebody to have a look first:

    img.setXYRatio(dpiInfo.XYRatio);
    
    opened by dmak 3
  • Update CRLVerifier.java

    Update CRLVerifier.java

    It is wrong to ask the signdate must be after the thisUpdate time of crl. For example, one pdf was signed in 2018-08-27 and the cert didn't be revoked. The CA update crl daily, so the thisUpdate time is 2018-08-28 and nextUpdate time is 2018-08-29. If I verify the pdf in 2018-08-28 and the cert isn't in the crl, it should be return the good status when check the revocation status of the cert.

    opened by lvtaoleo 3
  • Improve error reporting when processing bookmark destination

    Improve error reporting when processing bookmark destination

    When makeBookmarkParam is invoked with an empty dest array, fetching the first element without a guard will lead to an IndexOurOfBoundsException thrown by the underlying ArrayList. To prevent such obscure errors, we capture this illegal dest state and throw a more expressive exception instead.

    opened by salsolatragus 3
  • [SECURITY] Fix Temporary File Information Disclosure Vulnerability

    [SECURITY] Fix Temporary File Information Disclosure Vulnerability

    Security Vulnerability Fix

    This pull request fixes a Temporary File Information Disclosure Vulnerability, which existed in this project.

    Preamble

    The system temporary directory is shared between all users on most unix-like systems (not MacOS, or Windows). Thus, code interacting with the system temporary directory must be careful about file interactions in this directory, and must ensure that the correct file posix permissions are set.

    This PR was generated because a call to File.createTempFile(..) was detected in this repository in a way that makes this project vulnerable to local information disclosure. With the default uname configuration, File.createTempFile(..) creates a file with the permissions -rw-r--r--. This means that any other user on the system can read the contents of this file.

    Impact

    Information in this file is visible to other local users, allowing a malicious actor co-resident on the same machine to view potentially sensitive files.

    Other Examples

    The Fix

    The fix has been to convert the logic above to use the following API that was introduced in Java 1.7.

    File tmpDir = Files.createTempFile("temp dir").toFile();
    

    The API both creates the file securely, ie. with a random, non-conflicting name, with file permissions that only allow the currently executing user to read or write the contents of this file. By default, Files.createTempFile("temp dir") will create a file with the permissions -rw-------, which only allows the user that created the file to view/write the file contents.

    :arrow_right: Vulnerability Disclosure :arrow_left:

    :wave: Vulnerability disclosure is a super important part of the vulnerability handling process and should not be skipped! This may be completely new to you, and that's okay, I'm here to assist!

    First question, do we need to perform vulnerability disclosure? It depends!

    1. Is the vulnerable code only in tests or example code? No disclosure required!
    2. Is the vulnerable code in code shipped to your end users? Vulnerability disclosure is probably required!

    Vulnerability Disclosure How-To

    You have a few options options to perform vulnerability disclosure. However, I'd like to suggest the following 2 options:

    1. Request a CVE number from GitHub by creating a repository-level GitHub Security Advisory. This has the advantage that, if you provide sufficient information, GitHub will automatically generate Dependabot alerts for your downstream consumers, resolving this vulnerability more quickly.
    2. Reach out to the team at Snyk to assist with CVE issuance. They can be reached at the Snyk's Disclosure Email.

    Detecting this and Future Vulnerabilities

    This vulnerability was automatically detected by GitHub's CodeQL using this CodeQL Query.

    You can automatically detect future vulnerabilities like this by enabling the free (for open-source) GitHub Action.

    I'm not an employee of GitHub, I'm simply an open-source security researcher.

    Source

    This contribution was automatically generated with an OpenRewrite refactoring recipe, which was lovingly hand crafted to bring this security fix to your repository.

    The source code that generated this PR can be found here: SecureTempFileCreation

    Opting-Out

    If you'd like to opt-out of future automated security vulnerability fixes like this, please consider adding a file called .github/GH-ROBOTS.txt to your repository with the line:

    User-agent: JLLeitschuh/security-research
    Disallow: *
    

    This bot will respect the ROBOTS.txt format for future contributions.

    Alternatively, if this project is no longer actively maintained, consider archiving the repository.

    CLA Requirements

    This section is only relevant if your project requires contributors to sign a Contributor License Agreement (CLA) for external contributions.

    It is unlikely that I'll be able to directly sign CLAs. However, all contributed commits are already automatically signed-off.

    The meaning of a signoff depends on the project, but it typically certifies that committer has the rights to submit this work under the same license and agrees to a Developer Certificate of Origin (see https://developercertificate.org/ for more information).

    - Git Commit Signoff documentation

    If signing your organization's CLA is a strict-requirement for merging this contribution, please feel free to close this PR.

    Sponsorship & Support

    This contribution is sponsored by HUMAN Security Inc. and the new Dan Kaminsky Fellowship, a fellowship created to celebrate Dan's memory and legacy by funding open-source work that makes the world a better (and more secure) place.

    This PR was generated by Moderne, a free-for-open source SaaS offering that uses format-preserving AST transformations to fix bugs, standardize code style, apply best practices, migrate library versions, and fix common security vulnerabilities at scale.

    Tracking

    All PR's generated as part of this fix are tracked here: https://github.com/JLLeitschuh/security-research/issues/18

    opened by JLLeitschuh 0
  • [Snyk] Upgrade org.bouncycastle:bcpkix-jdk15to18 from 1.71 to 1.72

    [Snyk] Upgrade org.bouncycastle:bcpkix-jdk15to18 from 1.71 to 1.72

    Snyk has created this PR to upgrade org.bouncycastle:bcpkix-jdk15to18 from 1.71 to 1.72.

    :information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


    • The recommended version is 1 version ahead of your current version.
    • The recommended version was released 22 days ago, on 2022-09-29.

    Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.

    For more information:

    🧐 View latest project report

    🛠 Adjust upgrade PR settings

    🔕 Ignore this dependency or unsubscribe from future upgrade PRs

    opened by snyk-bot 0
  • [SECURITY] Fix Temporary Directory Hijacking or Information Disclosure Vulnerability

    [SECURITY] Fix Temporary Directory Hijacking or Information Disclosure Vulnerability

    Security Vulnerability Fix

    This pull request fixes either 1.) Temporary Directory Hijacking Vulnerability, or 2.) Temporary Directory Information Disclosure Vulnerability, which existed in this project.

    Preamble

    The system temporary directory is shared between all users on most unix-like systems (not MacOS, or Windows). Thus, code interacting with the system temporary directory must be careful about file interactions in this directory, and must ensure that the correct file permissions are set.

    This PR was generated because the following chain of calls was detected in this repository in a way that leaves this project vulnerable. File.createTempFile(..) -> file.delete() -> either file.mkdir() or file.mkdirs().

    Impact

    This vulnerability can have one of two impacts depending upon which vulnerability it is.

    1. Temporary Directory Information Disclosure - Information in this directory is visable to other local users, allowing a malicious actor co-resident on the same machine to view potentially sensitive files.
    2. Temporary Directory Hijacking Vulnerability - Same impact as 1. above, but also, ther local users can manipulate/add contents to this directory. If code is being executed out of this temporary directory, it can lead to local priviledge escalation.

    Temporary Directory Hijacking

    This vulnerability exists because the return value from file.mkdir() or file.mkdirs() is not checked to determine if the call succeeded. Say, for example, because another local user created the directory before this process.

    File tmpDir = File.createTempFile("temp", ".dir"); // Attacker knows the full path of the directory that will be later created
    // delete the file that was created
    tmpDir.delete(); // Attacker sees file is deleted and begins a race to create their own directory before the java code.
    // and makes a directory of the same name
    // SECURITY VULNERABILITY: Race Condition! - Attacker beats java code and now owns this directory
    tmpDir.mkdirs(); // This method returns 'false' because it was unable to create the directory. No exception is thrown.
    // Attacker can write any new files to this directory that they wish.
    // Attacker can read any files created within this directory.
    

    Other Examples

    Temporary Directory Information Disclosure

    This vulnerability exists because, although the return values of file.mkdir() or file.mkdirs() are correctly checked, the permissions of the directory that is created follows the default system uname settings. Thus, the directory is created with everyone-readable permissions. As such, any files/directories written into this directory are viewable by all other local users on the system.

    File tmpDir = File.createTempFile("temp", ".dir");
    tmpDir.delete();
    if (!tmpDir.mkdirs()) { // Guard correctly prevents temporary directory hijacking, but directory contents are everyone-readable.
        throw new IOException("Failed to create temporary directory");
    }
    

    Other Examples

    The Fix

    The fix has been to convert the logic above to use the following API that was introduced in Java 1.7.

    File tmpDir = Files.createTempDirectory("temp dir").toFile();
    

    The API both created the directory securely, ie with a random, non-conflicting name, with directory permissions that only allow the currently executing user to read or write the contents of this directory.

    :arrow_right: Vulnerability Disclosure :arrow_left:

    :wave: Vulnerability disclosure is a super important part of the vulnerability handling process and should not be skipped! This may be completely new to you, and that's okay, I'm here to assist!

    First question, do we need to perform vulnerability disclosure? It depends!

    1. Is the vulnerable code only in tests or example code? No disclosure required!
    2. Is the vulnerable code in code shipped to your end users? Vulnerability disclosure is probably required!

    Vulnerability Disclosure How-To

    You have a few options options to perform vulnerability disclosure. However, I'd like to suggest the following 2 options:

    1. Request a CVE number from GitHub by creating a repository-level GitHub Security Advisory. This has the advantage that, if you provide sufficient information, GitHub will automatically generate Dependabot alerts for your downstream consumers, resolving this vulnerability more quickly.
    2. Reach out to the team at Snyk to assist with CVE issuance. They can be reached at the Snyk's Disclosure Email.

    Detecting this and Future Vulnerabilities

    This vulnerability was automatically detected by GitHub's LGTM.com using this CodeQL Query.

    You can automatically detect future vulnerabilities like this by enabling the free (for open-source) GitHub Action.

    I'm not an employee of GitHub, I'm simply an open-source security researcher.

    Source

    This contribution was automatically generated with an OpenRewrite refactoring recipe, which was lovingly hand crafted to bring this security fix to your repository.

    The source code that generated this PR can be found here: UseFilesCreateTempDirectory

    Opting-Out

    If you'd like to opt-out of future automated security vulnerability fixes like this, please consider adding a file called .github/GH-ROBOTS.txt to your repository with the line:

    User-agent: JLLeitschuh/security-research
    Disallow: *
    

    This bot will respect the ROBOTS.txt format for future contributions.

    Alternatively, if this project is no longer actively maintained, consider archiving the repository.

    CLA Requirements

    This section is only relevant if your project requires contributors to sign a Contributor License Agreement (CLA) for external contributions.

    It is unlikely that I'll be able to directly sign CLAs. However, all contributed commits are already automatically signed-off.

    The meaning of a signoff depends on the project, but it typically certifies that committer has the rights to submit this work under the same license and agrees to a Developer Certificate of Origin (see https://developercertificate.org/ for more information).

    - Git Commit Signoff documentation

    If signing your organization's CLA is a strict-requirement for merging this contribution, please feel free to close this PR.

    Sponsorship & Support

    This contribution is sponsored by HUMAN Security Inc. and the new Dan Kaminsky Fellowship, a fellowship created to celebrate Dan's memory and legacy by funding open-source work that makes the world a better (and more secure) place.

    This PR was generated by Moderne, a free-for-open source SaaS offering that uses format-preserving AST transformations to fix bugs, standardize code style, apply best practices, migrate library versions, and fix common security vulnerabilities at scale.

    Tracking

    All PR's generated as part of this fix are tracked here: https://github.com/JLLeitschuh/security-research/issues/10

    opened by JLLeitschuh 0
  • [Snyk] Upgrade org.bouncycastle:bcprov-jdk15to18 from 1.70 to 1.71

    [Snyk] Upgrade org.bouncycastle:bcprov-jdk15to18 from 1.70 to 1.71

    Snyk has created this PR to upgrade org.bouncycastle:bcprov-jdk15to18 from 1.70 to 1.71.

    :information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


    • The recommended version is 1 version ahead of your current version.
    • The recommended version was released 23 days ago, on 2022-04-06.

    Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.

    For more information:

    🧐 View latest project report

    🛠 Adjust upgrade PR settings

    🔕 Ignore this dependency or unsubscribe from future upgrade PRs

    opened by snyk-bot 0
  • [Snyk] Security upgrade commons-io:commons-io from 2.4 to 2.7

    [Snyk] Security upgrade commons-io:commons-io from 2.4 to 2.7

    Snyk has created this PR to fix one or more vulnerable packages in the `maven` dependencies of this project.

    Changes included in this PR

    • Changes to the following files to upgrade the vulnerable dependencies to a fixed version:
      • xtra/pom.xml

    Vulnerabilities that will be fixed

    With an upgrade:

    Severity | Priority Score (*) | Issue | Upgrade | Breaking Change | Exploit Maturity :-------------------------:|-------------------------|:-------------------------|:-------------------------|:-------------------------|:------------------------- medium severity | 551/1000
    Why? Recently disclosed, Has a fix available, CVSS 5.3 | Directory Traversal
    SNYK-JAVA-COMMONSIO-1277109 | commons-io:commons-io:
    2.4 -> 2.7
    | No | No Known Exploit

    (*) Note that the real score may have changed since the PR was raised.

    Check the changes in this PR to ensure they won't cause issues with your project.


    Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.

    For more information: 🧐 View latest project report

    🛠 Adjust project settings

    📚 Read more about Snyk's upgrade and patch logic

    opened by snyk-bot 0
Releases(5.5.13.3)
  • 5.5.13.3(Feb 25, 2022)

    Since the release of iText 5.5.13 the iText 5 product line has transitioned to be in maintenance mode, meaning it only receives security related releases. While iText 5 is now EOL, we want to make sure that our users who have developed their solutions using iText 5 can safely continue using it.

    For this particular release, we’ve backported a security bug fix from iText 7.2.0 and 7.1.17 to resolve a vulnerability that allowed the use of GhostScript in an unpredictable manner. See CVE-2021-43113 for more information.

    In addition, we have updated the Apache XML Security for Java (org.apache.santuario:xmlsec) dependency to version 1.5.8 from version 1.5.6.

    The Bouncy Castle Crypto API for Java has also been updated to version 1.67 due to a flaw in the OpenBSDBCrypt.checkPassword() method present in 1.65 and 1.66. This was disclosed in CVE-2020-28052, see the link for more details.

    Note that if you use some of the older Java versions (Java 1.5-1.8) you might need to update the bouncy castle dependency to a different specific distribution. On Maven it's org.bouncycastle.bcprov-jdk15to18.

    From https://www.bouncycastle.org/latest_releases.html:

    "Further Note (users of Oracle JVM 1.7 or earlier, users of "pre-Java 9" toolkits): As of 1.63 we have started including signed jars for "jdk15to18", if you run into issues with either signature validation in the JCE or the presence of the multi-release versions directory in the regular "jdk15on" jar files try the "jdk15to18" jars instead."

    An example of an exception which might occur if the “standard" bouncy-castle distribution is used together with older Java versions:

    java.security.NoSuchAlgorithmException: 1.2.840.113549.3.2 KeyGenerator not available.

    Source code(tar.gz)
    Source code(zip)
    itext-pdfa-5.5.13.3.zip(645.44 KB)
    itext-xtra-5.5.13.3.zip(549.76 KB)
    itextpdf-5.5.13.3.zip(9.01 MB)
    xmlworker-5.5.13.3.zip(1.50 MB)
  • 5.5.13.1(Jun 20, 2019)

  • 5.5.13(Feb 12, 2018)

    iText 5.5.13 is a maintenance release that rolls up 4 bugfixes for iText 5 Core from the past 5 months:

    • As of this release XFA Worker is no longer supported on .NET 2.0 - instead you need to use .NET 4.0.
    • Support has been added for License Key Library 3.0.1. Users on License Key Library 1.0.x should migrate to 3.0.1.
    • 3 bugfixes for iText 5 Core 5.5.13.
    • 1 bugfix for XFA Worker 5.5.13 (commercial add-on, not on GitHub). Please be informed that at the same time we release pdfXFA 1.0.3, an add-on for iText 7. All bugfixes for XFA Worker 5.5.13 were ported to pdfXFA 1.0.3.

    No new functionality has been added since 5.5.11.

    The full list of changes can be found in the changelogs and the release in our download hub for Java and .NET.

    If you use Maven, then you can download iText from the Central Repository by adding one or more of the following XML snippets to your pom.xml:

    <dependency>
      <groupId>com.itextpdf</groupId>
      <artifactId>itextpdf</artifactId>
      <version>${itext.version}</version>
    </dependency>
    
    <dependency>
      <groupId>com.itextpdf</groupId>
      <artifactId>itext-pdfa</artifactId>
      <version>${itext.version}</version>
    </dependency>
    
    <dependency>
      <groupId>com.itextpdf</groupId>
      <artifactId>itext-xtra</artifactId>
      <version>${itext.version}</version>
    </dependency>
    
    <dependency>
      <groupId>com.itextpdf.tool</groupId>
      <artifactId>xmlworker</artifactId>
      <version>${itext.version}</version>
    </dependency>
    

    Still questions about the release, don't hesitate to contact us.

    Source code(tar.gz)
    Source code(zip)
  • 5.5.12(Aug 18, 2017)

    iText 5.5.12 is a maintenance release that rolls up 22 bugfixes for iText 5 Core from the past 5 months:

    • 22 bugfixes for iText 5 Core 5.5.12.
    • 6 bugfixes for XFAWorker 5.5.12 (Commercial add-on, not on GitHub).

    No new functionality has been added since 5.5.11.

    At the same time we also release pdfXFA 1.0.2, an add-on for iText 7. All bugfixes for XFAWorker 5.5.12 were ported to pdfXFA 1.0.2.

    Source code(tar.gz)
    Source code(zip)
    itext5-5.5.12.zip(11.64 MB)
  • 5.5.11(Mar 20, 2017)

  • 5.5.10(Oct 7, 2016)

  • 5.5.9(Mar 16, 2016)

  • 5.5.8(Nov 30, 2015)

    For this release, we combined the itextpdf, pdfa, xtra and xmlworker repositories on GitHub. You no longer need to download XML Worker separately, it is included in the ZIP file below. You'll have to make small changes to your development environment if you import the iText source code.

    A new site, a new release! We've been working very hard on a new web site that would contain more code samples and answers to questions. We've also made it easier to find the information you need by creating different, easy-to-understand categories, but also through better search functionality and the use of tags.

    iText 5.5.8 fixes a problem with digital signatures that was accidentally introduced in version 5.5.7. While we were at it, we also improved the verification of OCSP responses. There were also problems when signing PDFs that are compliant with the PDF/A-2, PDF/A-3 and ZUGFeRD standard. Those are now fixed.

    Other improvements involve:

    • Fonts: there were issues with some Noto fonts, we fixed the range of characters in the ToUnicode table, we provided a fallback mechanism in case of absent OS/2 tables,
    • Annotations: fixed some scaling issues and some flattening problems when skew and rotation are involved,
    • PdfReader: fixed partial reading when a PDF file is imported as a byte array,
    • Tagged PDF: fixed a problem with the structure tree when using page events,
    • Page labels: we received code contributions from Nick Park that improve page label extraction.

    We also have a new RUPS release. You can now click a stream in tree view to inspect its contents in a new window. This allows the user to keep a stream open while looking at other information such as the resources (fonts, XObjects, images,...) used by the stream.

    For the full list of updates, see the Changelog 5.5.8.

    Source code(tar.gz)
    Source code(zip)
    itext-5.5.8.zip(11.69 MB)
    itextg-5.5.8.zip(8.95 MB)
  • 5.5.7(Sep 17, 2015)

    There's a new 60-page tutorial in the works about creating e-Invoices with iText. This book will be presented at Adobe's Headquarters in San Jose at the PDF Association's PDF Technical Conference. In the pdfa jar of iText 5.5.7, you'll find code that allows you to create ZUGFeRD invoices as a PDF document with an XML attachment that complies either with the ZUGFeRD Basic profile or the ZUGFeRD Comfort profile. All you need to do to create the XML, is to implement either the BasicInvoice or the ComfortInvoice interface. These are invoices that consist of nothing but getX() methods in which you provide the content of your invoice (such as seller, buyer, invoice lines,...). The functionality is currently released in beta, let us know if you want more info before the official release of the tutorial.

    This release also brings several improvements, especially in these areas:

    • The CleanUp functionality: several bug fixes; we've also resolved some inconsistencies between iText and iTextSharp.
    • Forms: fixed some problems with special (or missing) fonts, fixed some edge cases when merging forms.
    • Tables: fixed edge case errors, for instance problem:
      • with skip first header/last footer,
      • when splitting rows,
      • regarding performance issues with nested tables.
    • Reading PDF: better exception messages when "bad" PDFs are being read. For instance: we've found a PDF that had (illegal) circular references that resulted in an endless loop. We can now fail early before the JVM goes out of memory.
    • Digital signatures: added functionality to manage the field lock dictionary, solved a problem with the signing time attribute, and other fixes We noticed some differences when using iText with Java 7 versus using iText with Java 8. These are now solved.

    We've added the PdfASmartCopy class. You can now choose for external caching when creating PDF/A (to save memory). We've also introduced some improvements to PdfStamper: you can now add named destinations, and you can incrementally update a file on disk (if you want to save memory).

    For the full list of updates, see the Changelog 5.5.7.

    Source code(tar.gz)
    Source code(zip)
    itext-5.5.7.zip(10.13 MB)
    itextg-5.5.7.zip(8.92 MB)
    xmlworker-5.5.7.zip(1.51 MB)
  • 5.5.6(May 8, 2015)

    If you compare the changelogs for iText 5.5.6 with previous change log entries (for instance the one for iText 5.5.5), you immediately notice that we're using a completely different style. We have successfully moved from Subversion on SourceForge as our main code repository to Git on a private GitLab server. From our GitLab server, the source code is now distributed to SourceForge (search for the git repositories, the svn repository is no longer updated) and to GitHub. Changelogs are now mostly generated automatically based on the git logs.

    This move immediately triggered some pull requests with code contributions from developers like you. One of these contributions made it into the final release: PdfGraphics2D now has support for CMYK.

    For this release, we have continued working on the CleanUp functionality in the xtra package. We now support redaction that involves lines and shapes. To achieve this, we enhanced the parser package so that it now also produces parsing info about operators such as moveTo, lineTo and stroke. We used a third party clipper library to do geometric calculations.

    There were also some improvements with respect to Arabic text. We are looking at fonts in general, and we are making good progress, but please don't expect the results in the next couple of releases. Better font support requires a lot of changes at the lowest level of iText and we won't release new font functionality before 2016.

    As always, we've added plenty of improvements and applied several bug fixes based on feedback from our paying customers and based on feedback from users on StackOverflow. Note that the changelogs contain links to JIRA: that's our closed ticketing system. Only paying customers have access to this issue tracker, but most of the tickets are only visible to core iText developers.

    Source code(tar.gz)
    Source code(zip)
    itext-5.5.6.zip(9.78 MB)
    itextg-5.5.6.zip(8.88 MB)
    xmlworker-5.5.6.zip(1.50 MB)
  • 5.5.5(Apr 3, 2015)

    We're releasing iText 5.5.5 on iText's 15th birthday: February 14, 2015 and if we take a look at the changelog, we see that we're making progress in a couple of related areas. Returning topics are text extraction, compare tool and clean-up functionality. The common denominator of these three evolutions is PDF parsing.

    Text extraction:

    We have fixed a bug that was introduced very recently and that was reported by many different developers. This bug caused an ArrayIndexOutOfBoundsException when an empty String was encountered. We improved parsing of Type3 fonts and we improved parsing of Unicode fonts. Documents that used to result in nothing but white space, are now converted to actual text. Of course: there will always be broken PDFs that can never be parsed correctly, no matter which tool you use.

    Compare tool:

    As parsing improves, we can come up with better ways to compare PDFs. We have a large suite of tests that generate PDF documents and then compare the result with a reference PDF. This isn't trivial as two PDFs that are created using the same code are never identical by design (that's inherent to the PDF specification). There are different strategies one can use to compare such PDFs and we are constantly improving our compare tool by adding new strategies.

    Clean-up functionality:

    This is a work in progress that was started in iText 5.5.4. At that time, the development was done in the Java version of iText only. We have now ported this functionality to C# and we have improved the functionality. For instance: whereas we only allowed redaction of text in 5.5.4, we now also allow redaction of images. The work isn't finished yet: we still have several edge cases to fix and redaction of curves isn't covered yet.

    Apart from these three major areas, we also fixed a number of issues that were reported. If you use the XMP functionality, it is important for you to upgrade to protect yourself against the XML External Entity (XXE) attacks that were reported on December 31, 2014. We also fixed some problems related to Tagged PDF and fonts.

    Finally, let's take a look at the other iText projects:

    • We won't make a RUPS release, because no new functionality was added to RUPS.
    • The new XML Worker version will only bring a handful of improvements (that might be important if you use tables)
    • As usual, users provided us with a new series of XFA forms with special features that we integrated into a new XFA Worker release.

    That's all for iText 5.5.5. Let's start working on iText 5.5.6!

    Source code(tar.gz)
    Source code(zip)
    itext-5.5.5.zip(9.33 MB)
    itextg-5.5.5.zip(8.50 MB)
    xmlworker-5.5.5.zip(1.48 MB)
  • 5.5.4(Dec 17, 2014)

    We're releasing iText 5.5.4 on December 17, exactly 3 months after the previous release. If you scroll down in the changelog, you notice that once again, XFA Worker has received plenty of attention. Our initial XFA customers are very happy with the functionality we provided in previous versions, but new XFA customers are discovering more and more features in the XFA spec and we're consistently adding these features to XFA worker.

    But let's focus on the open source part of iText:

    The most promising new feature is hidden in a single line: Added PDF "clean up" functionality that can be used for redaction. We don't have any examples yet, but it seems that more and more people are asking for functionality that allows you to remove content from a PDF. With "to remove", we don't mean "covering it with a colored rectangle", but to actually remove content from the PDF's content stream. Currently, we allow removing content based on redaction annotations as well as based on rectangles you can define in your code. This functionality is currently only available in the Java version, it hasn't been ported to C# yet (it's on our TODO list). Once we have some examples, we count on your feedback to improve this functionality.

    Our efforts with respect to PDF/A support seem to be appreciated. We've received interesting feedback and... some bug reports. We fixed problems with images in PDF/A-1A, problems with combinations of PDF/A-2 and signatures, we've added ZUGFeRD extension levels, and so on... On a related note: we've added some fixes that help people to avoid a common pitfall when manipulating a Tagged PDF document. When creating PDF from HTML, we now take the alt value of an tag into account.

    Some languages have a "right to left" writing system that can be set with the dir attribute in HTML. We've now added support for this attribute in XML Worker, and while we were at it, we've added support for justified text when writing from right to left.

    We've discovered that some people were using the LargeElement functionality for PdfPTables in a way that made them lose a row and/or a header. We applied a fix so that this wouldn't happen anymore in the future.

    These are the most important enhancements and fixes, you can take a look at the changelog for more info.

    We've improved PdfGraphics2D when using font families for which there are no fonts available for every style (for instance: no bold font, no italic font, or not bold-italic font).

    Source code(tar.gz)
    Source code(zip)
    itext-5.5.4.zip(9.31 MB)
    itextg-5.5.4.zip(8.47 MB)
    xmlworker-5.5.4.zip(1.47 MB)
  • 5.5.3(Sep 17, 2014)

    In the previous release dating from two months ago, we focused on XML Worker parsing HTML and CSS. In today's release, you'll discover that we focused mainly on XFA Worker. XFA is a closed source add-on written on top of iText. We've made the JavaScript interpretation more flexible, fixed page breaking mechanisms and issues with tables, and so on... All of these changes resulted from support tickets posted by customers.

    This doesn't mean we didn't do any work on the other iText products:

    • iText: we've solved some problems when merging PDFs with interactive features using PdfCopy. We've added support for flattening annotations for which appearances were defined. We've made form-filling less dependent from the NeedAppearances flag to avoid confusion. We've fixed a problem that occurred when the rectangle of a field's widget annotation differs from the bounding box of its appearance. We've discovered that our PDF/A checker was too strict in some cases. We've fixed a problem with Datamatrix matrix codes. And we've further improved the PDF parsing functionality concerning inline images.
    • RUPS: We've made RUPS more user-friendly by adding short-cuts and menu entries for instance to open the PDF in a PDF viewer. We've also made it easier to navigate through a document.
    • XML Worker: We've added some extra CSS functionality involving images that was overlooked in the previous release.

    Now we'll start preparing for our Java One tutorial session. If you're in San Francisco for the event, make sure you visit the iText booth.

    http://itextpdf.com/changelog/553

    Source code(tar.gz)
    Source code(zip)
    itext-5.5.3.zip(9.24 MB)
    itextg-5.5.3.zip(8.48 MB)
    xmlworker-5.5.3.zip(1.47 MB)
  • 5.5.2(Jul 25, 2014)

    Two months have passed since iText 5.5.1 and we're ready to release iText 5.5.2. Although the changelog may seem relatively short, there's one line in specific we've put a lot of effort into: Major improvements to the CSS parser. This is actually a complete rewrite of the CSS functionality, resulting in much better interpretation of CSS syntax. You'll find these changes in iText's XML Worker. The HTMLWorker class that was shipped with iText core was finally deprecated.

    We noticed that many people are starting to be aware of Tagged PDF, PDF/A and PDF/UA. We received numerous questions on the subject of merging Tagged PDFs, more specifically PDF/A compliant documents. This wasn't supported in previous versions and it's also kind of tricky because you can't just mix the different flavors of PDF/A. For instance: you shouldn't expect that a PDF/A-1B document merged with a PDF/A-2A document will result in a PDF/A-2A document. Nevertheless we've added a class PdfACopy that allows you to make combinations that make sense and that throws an exception when you're trying to make a combination that doesn't.

    We made sure that you can't use the PageStamp functionality when using PdfCopy in tagged mode. This way, we avoid that people don't introduce untagged data out of ignorance regarding the nature of Tagged PDF. PdfCopy now also supports merging fields with tags.

    When parsing documents with Type 3 fonts, we used to return space characters because Type 3 fonts are user defined fonts where a random character is mapped to a custom made glyph. We've changed this so that iText returns the characters that were stored inside the PDF. This doesn't always make sense because it can result in a set of random characters, but it is more in line with what people expect when parsing a PDF file that contains Type 3 fonts.

    Finally, we've introduced functionality to cache objects to improve the PDF writing process, and we've improved the generic testing framework.

    Source code(tar.gz)
    Source code(zip)
    itext-5.5.2.zip(9.23 MB)
    itextg-5.5.2.zip(7.92 MB)
    xmlworker-5.5.2.zip(1.47 MB)
  • 5.5.1(Jul 25, 2014)

    About a month ago, Adobe announced that it would never support XFA forms in Adobe Reader on mobile platforms (see blogs.adobe.com on April 16, 2014. XFA forms are much more dynamic and interactive than ordinary PDF forms (AcroForms) and some mobile operating systems place restrictions on what can be done on a mobile device.

    This makes it very difficult (impossible actually) to provide the same dynamic PDF experience you expect on the desktop across all mobile devices using PDF. As a result, Adobe Reader Mobile does not support XFA based PDF’s created in the LiveCycle Designer and it will not provide this support in the future.

    Does this mean XFA is no longer important? On the contrary! A year ago, our colleagues at IDR Solutions already explained why XFA is important on their blog.

    But then how are we going to present these forms on mobile devices?

    There are basically two options. Adobe and IDR Solutions offer the interactive solution, converting XFA to HTML 5 for consumptions on the mobile device. We offer the non-interactive solution, where we flatten the XFA form into an ordinary PDF document that can be viewed in any PDF viewer. The former solution is recommended when the form needs to be dynamic and when you need the form to respond to user input; the latter solution is recommended when you want to display, archive, secure the data in the form.

    When you look at the changelogs of iText 5.5.1, you immediately see that we've invested in even more development of XFA Worker.

    Now that XFA Worker creates Tagged PDF, our customers started experimenting with the generation of PDF/A and PDF/UA from XFA forms. This resulted in some extra enhancements and bug fixes. For instance: we discovered that we didn't fully support PDFs that comply with PDF/A as well as PDF/UA from XFA. This is now fixed.

    Apart from further PDF/A enhancements, we introduced a conformance level that allows you to create documents that are in compliance with the ZUGFeRD standard (for instance: invoices). The ZUGFeRD standard is a superset of PDF/A-3 where you combine a human-readable PDF with a machine-readable XML attachment.

    Talking about XML: We have also fixed a number of bugs in XML Worker. Some combinations of tags gave odd results, and there was a problem with tables and rowspans.

    As we speak, the ISO committee for the PDF standards is meeting in South-Africa. One of the new standards that is being discussed involves XFDF. This new standard introduces much needed documentation for the Forms Data Format in general. We noticed that FDF is used quite frequently and we added some new functionality. Important: the input source is no longer closed automatically when using FdfReader; you're responsible for closing that stream in your code.

    Finally, we still find ways to improve RUPS. Not a day goes by without us using RUPS to look inside a PDF.

    Source code(tar.gz)
    Source code(zip)
    itext-5.5.1.zip(9.21 MB)
    itextg-5.5.1.zip(7.92 MB)
    xmlworker-5.5.1.zip(1.44 MB)
  • 5.5.0(May 20, 2014)

    In 2013, we had 6 iText releases, numbered from iText 5.4.0 to 5.4.5. For the first release of 2014, we thought it would be a good idea to switch to iText 5.5.0. That way, we get an idea of the release year, just by looking at the number. But let's take a look at what's more important: what's new in this release?

    We received plenty of feedback regarding the accessibility functionality that was introduced last year. The PDF/UA spec is relatively new and the ISO committee is still fixing a couple of issues that were discovered in the first version. The same goes for iText. For instance: we discovered that backgrounds added to Chunks weren't marked as artifacts, attributes for Form XObjects weren't written correctly, and so on. We also received some bug reports after the PdfCopy update, especially when merging forms. We've fixed these and a couple of other bugs. For example: there were problems if the NeedAppearances flag was set for one of the original forms. Furthermore, we've won another battle in the never-ending struggle to support different flavors of the TIFF format. We've solved 56 issues in total! We've extended the testing infrastructure. The existing CompareTool class has been moved to a separate testutils package. And we've implemented the suggestion made by Valentin Ivanov and David Hook, allowing the use of an external decryption process (sorry for the delay, guys).

    We've also released XML Worker, iText RUPS and XFA Worker (the latter is a closed source project).

    RUPS was originally an acronym for Reading and Updating PDF Syntax, but up until now, it wasn't possible to Update a PDF file. Michaël Demey has now introduced some functionality that allows you to change a dictionary (add, update, delete keys) and to save an altered PDF. He added more interactivity (short cut keys) and a way to consult the content of a PDF page as plain text.

    As for XFA Worker, more and more customers are using dynamic forms as templates and XFA Worker to populate these templates with data with a PDF (or even a PDF/A Level A and PDF/UA) documents as final result. We also have an increasing demand for trial licenses, resulting in excellent reports of small features that aren't supported yet. In answer to the requirements of our paying customers, we've started developing formcalc support (the sum() method and some arithmetic functions). We received kudos for our work on XFA Worker from our customer at the US Courts, and we suddenly realized that prospective customers weren't able to see the progress on this product. With this release, we're also publishing the changelog for this add-on for iText.

    Source code(tar.gz)
    Source code(zip)
    itext-5.5.0.zip(9.13 MB)
    itextg-5.5.0.zip(7.85 MB)
    xmlworker-5.5.0.zip(1.43 MB)
  • 5.4.5(Dec 3, 2013)

    The work that was planned for iText 5.4.4, but postponed due to a customer priority, has now been done: we have completed support for PDF/A, more specifically PDF/A-2 and PDF/A-3. XAdES-EPES support has also been added.

    Apart from the work that was scheduled, we've also fixed some iText 5.4.4-related issues that were reported to us by our customer; the new PdfCopy functionality to preserve the structure tree as well as the interactive form fields should now be ready for use. At the same time, some other PDF/UA-related issues were fixed, even in iText RUPS.

    Other improvements include the parsing functionality and an extra digital signatures feature that allows you to add information about the application that signed the PDF to the signature dictionary. As always, we've also fixed some bugs, for instance in XML Worker where we still experienced some problems with images in cells and with the order in which CSS styles are processed.

    Source code(tar.gz)
    Source code(zip)
    itext-5.4.5.zip(8.67 MB)
    itextg-5.4.5.zip(7.81 MB)
    xmlworker-5.4.5.zip(1.34 MB)
  • 5.4.4(Mar 14, 2016)

  • 5.4.3(Mar 14, 2016)

Owner
iText
Technical support: https://itextpdf.com/support
iText
Extract text from a PDF (pdf to text). Api for PHP/JS/Python and others.

Extract text from a PDF (pdf to text). API in docker. Why did we create this project? In the Laravel project, it was necessary to extract texts from l

dotcode.moscow 6 May 13, 2022
The Apache PDFBox library is an open source Java tool for working with PDF documents

Apache PDFBox The Apache PDFBox library is an open source Java tool for working with PDF documents. This project allows creation of new PDF documents,

The Apache Software Foundation 1.8k Dec 31, 2022
Extract tables from PDF files

tabula-java tabula-java is a library for extracting tables from PDF files — it is the table extraction engine that powers Tabula (repo). You can use t

Tabula 1.5k Jan 9, 2023
XML/XHTML and CSS 2.1 renderer in pure Java

Flying Saucer OVERVIEW Flying Saucer is a pure-Java library for rendering arbitrary well-formed XML (or XHTML) using CSS 2.1 for layout and formatting

null 1.8k Jan 2, 2023
Java reporting library for creating dynamic report designs at runtime

Master Development Dynamic Reports DynamicReports is an open source Java reporting library based on JasperReports. It allows to create dynamic report

Dynamic Reports 165 Dec 28, 2022
An HTML to PDF library for the JVM. Based on Flying Saucer and Apache PDF-BOX 2. With SVG image support. Now also with accessible PDF support (WCAG, Section 508, PDF/UA)!

OPEN HTML TO PDF OVERVIEW Open HTML to PDF is a pure-Java library for rendering arbitrary well-formed XML/XHTML (and even HTML5) using CSS 2.1 for lay

null 1.6k Dec 29, 2022
Extract text from a PDF (pdf to text). Api for PHP/JS/Python and others.

Extract text from a PDF (pdf to text). API in docker. Why did we create this project? In the Laravel project, it was necessary to extract texts from l

dotcode.moscow 6 May 13, 2022
An extensible Java framework for building XML and non-XML streaming applications

Smooks Framework This is the Git source code repository for the Smooks Project. Build Status Building Pre-requisites JDK 8 Apache Maven 3.2.x Maven gi

Smooks Framework 353 Dec 1, 2022
Worker-queue implementation on top of Java and database

Database Queue Library provides worker-queue implementation on top of Java and database. Fintech company YooMoney uses db-queue in cases where reliabi

null 17 Dec 12, 2022
The Apache PDFBox library is an open source Java tool for working with PDF documents

Apache PDFBox The Apache PDFBox library is an open source Java tool for working with PDF documents. This project allows creation of new PDF documents,

The Apache Software Foundation 1.8k Dec 31, 2022
Extract tables from PDF files

tabula-java tabula-java is a library for extracting tables from PDF files — it is the table extraction engine that powers Tabula (repo). You can use t

Tabula 1.5k Jan 9, 2023
Simple Cordova plugin to save a pdf file in MediaStore.Downloads

com-thesis-plugins-pdfstore This simple Cordova plugin saves a bytestring (the byte image of a pdf) to a pdf file in MediaStore.Downloads. The purpose

Alberto Ferrari 2 Feb 2, 2022
Simplified PDF Data Extraction

PDF Mantis Simplified PDF Data Extraction Table of Contents What is PDF Mantis Why was PDF Mantis created and who is it for Requirements Installation

null 5 Dec 1, 2021
Java XML library. A really cool one. Obviously.

XMLBeam This is a Java XML library with an extraordinary expressive API. By using XPath for read and write operations, many operations take only one l

Sven Ewald 70 Aug 25, 2022
A low intrusive, configurable android library that converts layout XML files into Java code to improve performance

qxml English 一个低侵入,可配置的 Android 库,用于将 layout xml 文件转换为 Java 代码以提高性能。 与X2C的对比 X2C: 使用注解处理器生成View类,使用时需要在类中添加注解,并替换setContentView方法,侵入性较强; 对于布局属性的支持不够完美

null 74 Oct 6, 2022
SitemapGen4j is a library to generate XML sitemaps in Java.

sitemapgen4j SitemapGen4j is a library to generate XML sitemaps in Java. What's an XML sitemap? Quoting from sitemaps.org: Sitemaps are an easy way fo

Dan Fabulich 151 Dec 16, 2022