Skip to main content
Skip table of contents

Release iText 5.1.2

Maintenance release of iText 5.1.2; change in architecture for XML Worker.

Release Notes:

iText 5.1.2 Core

In this release, we've added functionality that allows you to completely remove an optional content layer (OCG). However: iText 5.1.2 is mainly a maintenance release that fixes a series of bugs reported on this list since June 8: the algorithm to find startxref was made more memory efficient; the height of the Image wasn't taken into account when creating a PdfPCell with an Image (this is a bug that was introduced in iText 5.1.1); fixed a problem when an XFA stream didn't contain a datasets node; fixed a bug in the signature validation process; fixed a bug where iText introduced the namespace prefix "xmp" when "xap" was expected; and so on.

This release also allows us to release a new version of XML Worker:

XML Worker 1.1.0

In this release we've added support for more HTML tags and CSS attributes, but the main difference is a change in the architecture. If you were using previous versions of XML Worker, you'll need to make some changes to your own code after upgrading to XML Worker 1.1.0. The change in the architecture was necessary to fix some threading problems. Working with byte[] instead of String also turned out not to be a good idea.

We hope you'll enjoy the new functionality and we wish you a smooth upgrade.


iText 5.1.2 Core

  • Changes made by Emiel Ackermann
    • Bugfix: In the PdfContentByte.drawTextField() method, the graphic state was not saved and restored. This caused the default font color to become white, which made all text unreadable.
  • Changes made by Balder Van Camp
    • PdfArray: make Iterable
    • Bugfix: In the PdfContentByte.drawButton() and PdfContentByte.drawRadioField() methods, the graphic state was not saved and restored. This caused the default font color to become white, which made all text unreadable.
  • Changes made by Kevin Day
    • PRTokeniser: Made the algorithm to find startxref more memory efficient.
    • RandomAccessFileOrArray: Improved handling for huge files that can't be mapped
    • CMapAwareDocumentFont: fix NPE if mapping doesn't get initialized (I'd rather wind up with junk characters than throw an unexpected exception down the road)
  • Changes made by Bruno
    • Javadoc clarifications
    • Removed unnecessary imports
    • Bugfix: The height of the Image wasn't taken into account when creating a PdfPCell with an Image. (This bug was introduced in version 5.1.1, due to the "List symbol attributes were ignored" fix)
    • Undo of the suggestion implemented in 5.1.1 regarding the defaults for setUseAscender/setUseDescender
    • Bugfix: Some XFA streams don't have a datasets node. If this is the case, we have to add one.
    • Bugfix: Bug in the signature validation process, discovered by Stefan Santesson (3xA Security). Stefan fixed the bug and has sent the fix to the mailing list on 2011-08-09.
    • PdfPKCS7: Added getters for digestEncryptionAlgorithm and digestAlgorithm as suggested by Stefan Santesson (3xA Security)
    • Bugfix: Problem reported on the mailing list by somebody named Stefan (June 28, 2011). A namespace prefix "xmp" caused problems because "xap" was expected. The problem was examined by Leonard Rosenthol and Michael Klink. Leonard explained that according to the specs "xmp" should be preferred, but Michael argued that although "xmp" is preferred, "xap" is allowed. In this fix, iText no longer forces the use of "xmp", but tries to detect which namespace prefix is expected.
    • Bugfix: There was inconsistent behavior when using /t characters. iText ignores them when doing calculations, but adds them to the document anyway and they aren't being ignored by some viewers.
    • New functionality that allows you to completely remove an OCG layer (in the extra jar).

XML Worker 1.1.0

We jump from version 1.0.1 to 1.1.0 because there has been a huge change in the architecture of XML worker.
  • Changes made by Balder
    • Javadoc updates
    • HTML: added more tags
    • CSS: added more properties
    • Bugfix: see bug report #3332534 "//s" should be "\\s"
    • Pipeline: added init method, replaces setContext() and getNewCustomContext() methods, and is called automatically in XMLWorker on the XMLParserListener init method call.
    • WorkerContext passed as argument in Pipeline open, text, close, init. Also passed as argument to TagProcessor methods.
    • XMLParser now calls listeners init before starting to read and calls listeners close just before closing the stream/reader
    • CSSResolver now uses ObjectContext
    • CssFiles now has a clear method that will clear al CssFiles marked as non persistent.
    • Added protected createTag() method that is responsible for constructing new Tag objects, add a protected getCurrentTag() method
    • fix a major threading bug. the currentTag is now kept in the WorkerContext, overlooked it when refactoring.
    • Allow attributes without values, they are set in the tags attribute map with an empty string value
    • Add boolean compareTag(Tag t) to
    • Made Tag iterable, added getChild(), hasChild(), ... methods (plus recursive tree inspection on demand)
    • Throw exception if InputStream in == null
    • Added protected getLocalWC() to XMLWorker to allow extending classes to retrieve the local WorkerContext object and allow extending classes to create their own WorkerContext (e.g one not hold in a ThreadLocal)
    • Bugfix: Namespace was not flushed after detection, all following tags also had the namespace of the last found namespace
    • Added a method to Tag which returns all children with a certain name.
    • Change reading from file to reading with Reader instead of a Stream, an encoding should set now. Reading chars in the parser instead of bytes. Passing a string to the pipeline for the content; if no encoding is set, use the jvm's default encoding.
    • Make Tags use statics from Tag
    • Switched Tag.getTag() calls to Tag.getName()
  • Changes made by Emiel Ackermann
    • Javadoc corrections
    • Background-color style is now applied on chunk level.
    • Bug reported by Roel De Nijs concerned fixed cell and table widths is fixed:
      • fixed width of a td tag with a colspan > 1 is now evenly distributed over the columns.
      • if a table has a fixed width different from its columns' fixed widths, the width of the table is taken as target and the columns are widened proportionally.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.