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.
Changelog:
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.
- Bugfix: In the
- Changes made by Balder Van Camp
PdfArray
: makeIterable
- Bugfix: In the
PdfContentByte.drawButton()
andPdfContentByte.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 findstartxref
more memory efficient.RandomAccessFileOrArray
: Improved handling for huge files that can't be mappedCMapAwareDocumentFont
: 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 aPdfPCell
with anImage
. (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 fordigestEncryptionAlgorithm
anddigestAlgorithm
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
- 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, replacessetContext()
andgetNewCustomContext()
methods, and is called automatically inXMLWorker
on theXMLParserListener
init method call.WorkerContext
passed as argument inPipeline
open, text, close, init. Also passed as argument toTagProcessor
methods.XMLParser
now calls listeners init before starting to read and calls listeners close just before closing the stream/readerCSSResolver
now usesObjectContext
CssFiles
now has a clear method that will clear alCssFile
s marked as non persistent.- Added protected
createTag()
method that is responsible for constructing newTag
objects, add a protectedgetCurrentTag()
method - fix a major threading bug. the
currentTag
is now kept in theWorkerContext
, 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)
toTag.java
- Made
Tag
iterable, addedgetChild()
,hasChild()
, ... methods (plus recursive tree inspection on demand) - Throw exception if
InputStream
in == null - Added protected
getLocalWC()
toXMLWorker
to allow extending classes to retrieve the localWorkerContext
object and allow extending classes to create their ownWorkerContext
(e.g one not hold in aThreadLocal
) - 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 aStream
, an encoding should set now. Readingchar
s in the parser instead ofbyte
s. Passing a string to the pipeline for the content; if no encoding is set, use the jvm's default encoding. - Make
Tags
use statics fromTag
- Switched
Tag.getTag()
calls toTag.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.