iText 5.3.0 — XML Worker 1.1.4



iText 5.3.0

  • Changes made by Paulo Soares
    • Upgrade to BouncyCastle version 1.47 (multiple updates in April and May after serious testing)
    • Complete refactoring of the way digital signatures are created (together with Bruno).
      • Moving all signature-related code to a separate security package.
      • Splitting up large classes in smaller, functional classes.
      • Removal of subfilters that will be deprecated in ISO-32000-1, in favor of detached signatures (PKCS#7 as well as CAdES-based).
      • Added a convenience method to do a detached signature.
      • Introduction of an ExternalSignature interface (makes it easier to implement signing with a smart card).
      • If a certificate doesn't contain a common name, use the email address instead.
    • Bugfix ByteBuffer: overloaded method to deal with longs. It caused an error in signing very large files.
    • Bugfix: vertical CJK cmaps weren't being loaded correctly.
  • Changes made by Eugene Markovskyi
    • Added a CompareTool class that depends on the presence of GhostScript to compare PDF output.
    • Bugfix XfaForm: avoid NullPointerException
    • Bug #3514868 reported by Mike Horsey: wrong leading in Paragraphs. Eugene didn't use the proposed workaround, but fixed the problem differently.
    • Paragraph: improved cloneShallow() and breakUp() logic. The first item must inherit paragraph spacing before. The last - spacing after. Some regression fixed.
    • Bugfix ColumnText composite content processing: the ascent should be used as leading for the first line of the paragraph which are placed after table.
    • Improving of fit page logic for PdfPTable. The skipFirstHeader flag should be taken into account.(suggested by Jason Berk)
    • Bugfix PdfLine: The line ascent/descent should be taken into account for the text rise.
    • ColumnText: Image isScaleToFitLineWhenOverflow flag is extended. The image is scaled if the image height overflow the ColumnText height.
    • Type1Font: added method for updating of font metrics (+ empty implementation in the BaseFont class).
    • Introduced a "whitespace" Chunk to solve the problem of "disappearing spaces" in XML Worker.
    • Extra method to extract XFA nodes (originally written for XFA worker).
    • Introduction of PdfDiv element that allows you to add floating content.
    • ColumnText fix: if compositeColumn(inside goComposite(...)) doesn't place any text lines, the descent shouldn't be updated.
    • ColumnText: Added getter for current leading.
    • ColumnText fix: the currentLeading should be updated by compositeColumn.currentLeading.
  • Changes made by Raf Hens
    • Image class: now also extracting the resolution if stored in Photoshop IRBs
  • Changes made by Kevin Day
    • LocationTextExtractionStrategy: old comparison approach caused runtime exceptions in Java 7
  • Changes made by Bruno
    • Removed some unused imports in different classes.
    • PdfReader: If you use the RecipientInformation.getContent(recipient) method instead of the deprecated RecipientInformation.getContent(key, provider) method, the Java class loader needs to load the Recipient.class file and for obvious reasons this results in a NoClassDefFoundError if the BC jars aren't in the CLASSPATH. However: we don't want to force people to have the BC jars in their CLASSPATH if no encryption or digital signing is involved. As a temporary solution, I moved the RecipientInformation.getContent(recipient) to the PdfEncryptor class so that the class loader doesn't need to load Recipient if no encryption is involved.
    • PRAcroForm: Clarification regarding the different between the full name of a field (parent path + /T entry) and the name of the widget annotation (/NM entry).
    • Added extra check to avoid that a user creates a page that is too large. As per ISO-32000-1, the maximum size of a page is 14,400 by 14,000 user units.
    • Bug #3522006 reported by abysas: ArrayIndexOutOfBoundsException in MappedRandomAccess class because of wrong test (I replaced a > by a >=).
    • If you explicitly set the XMP metadata in PdfStamper, you take the responsibility to create a correct metadata stream, and iText shouldn't overrule it.
    • Bug #3507960 reported by InteractUK: I made some small changes to avoid an out of bound exception in TextField for choice fields with zero options.
    • PdfGraphics2D: Made some private variables protected to allow easier subclassing (for instance to change drawString() for better RTL support).
    • Deprecated HTMLWorker in favor of XML Worker.
    • ColumnText: in composite mode, we don't want the first line indentation to be repeated if there's a newline inside a Paragraph.
    • ColumnText (and PdfPCell) scale down images if they don't fit the rectangle, but in some cases, you don't want the image to be scaled down. I've set the scaleToFitLineWhenOverflow to true by default (this will have an effect on existing code that wraps images in Chunks), and I used this parameter to decide whether or not to scale an image in a table (this shouldn't have an effect on existing code as I've set scaleToFitLineWhenOverflow to true by default).
    • PdfSmartCopy: Instead of storing only streams, we now also store dictionaries. This dramatically reduces the resulting file size, for instance when concatenating documents using the same non-embedded fonts.
    • Worked on the classes for digital signing. Added comments. Helped splitting up the code.

XML Worker 1.1.4

  • Changes made by Alexander Chingarev
    • CssAppliersImp: made some private variables protected.
  • Changes made by Eugene Markovskyi
    • Fixed the disappearing spaces problem (together with Bruno).
    • XMLWorkerHelper: defaultCssFile should be used only for default.css.
    • Some XMLWorkerHelper interfaces changed: new parseXHtml() methods with extra (or less) parameters such as a FontProvider.
    • Chunk.NEWLINE shouldn't be used directly. A new line element is created as a copy of Chunk.NEWLINE and then the styles are applied to this element.
    • HTML tables:
      • Support list items (not wrapped by list element) inside table cell (td tag). These list items should use zero left indention.
      • Fixed double border issue fixed by the case insensitive attribute name mapping.
      • Improved table cell spacing.
    • The last margin bottom is reseted before a tag is opened and reverted before the tag is closed. This is necessary for deep nested HTML elements because the last margin bottom could be missed or overwritten by child element.
    • XMLWorkerFontProvider: changed fontSubstitutionMap to protected. This is more convenient for implementing subclasses.
    • HtmlCellCssApplier: Image isScaleToFitLineWhenOverflow flag is extended. The image is scaled if the image height overflow the ColumnText height.
    • Support for "position: relative" and float layout CSS properties using PdfDiv object
    • Fixed a problem with <ul> tags inside a <table> tag (bullets were all wrong).
  • Changes made by Bruno Lowagie
    • Fixed the disappearing spaces problem (together with Eugene).
    • XMLWorkerHelper: Extra convenience method that was needed because parseXHtml() with value null for the Charset was ambiguous.
    • XMLWorkerFontProvider: People should be able to chose whether or not to use unicode.
    • Fix: If you want to create a PDF with nothing but embedded fonts, you need to apply the CSS to all chunks, even the white space chunks.

RUPS 1.0.2

  • Changes made by Raf Hens
    • Added syntax highlighting for content streams (with hard coded config, for now)
    • Fixed infinite loop problem in logging console