Breaking changes for iText 9
General breaking changes list
SLF4J dependency is updated from 1.7 to 2.0.16, this forces the user to update logback to at least version 1.3.X because logback 1.2.X does not work with SLF4J 2.X
Conformance changes:
com.itextpdf.kernel.pdf.IConformanceLevel
interface was removed and replaced by aggregatorPdfConformance
class which can store both PDF/A and PDF/UA conformance.com.itextpdf.kernel.pdf.PdfAConformanceLevel
andPdfUAConformanceLevel
classes with constants were replaced byPdfAConformance
andPdfUAConformance
enums.
We have made a lot of fields private, in most cases we provide getters and/or setters, as well as make some constants final.
F.e. Getting the start value for GlyphLine:
Before:
glyphLine.start
Now:
glyphLine.getStart()
F.e. Setting the end value for GlyphLine:
Before:
glyphLine.end = 23;
Now:
glyphLine.setEnd(23);
Kernel module
Breaking change | Upgrade path |
---|---|
Changed
| Page number was never properly supported and didn’t have any meaning. So, do not use |
Changed
|
|
Removed deprecated | Shouldn’t be used |
Removed | Use |
Removed | Use
CODE
|
Modified
| Use |
Renamed and moved Also added new | Use |
Moved Also replaced | Use |
Moved Also replaced | Use |
Removed in | This was not intended to be a public method, use the methods with the PageDictionary |
PdfWriter now throws an IOException instead of FileNotFoundException. | Instead of throwing a |
Modified
| Instead of direct accessing |
Modified
| Use another constructor |
Modified
| Instead of direct accessing, use |
Modified
| Implement For |
Modified
| These methods are for internal usage only (that’s why they moved to |
Modified
| |
Modified
| |
Propagated the inner PdfShading classes into seperate independent class files, as well as renamed the base class.
| Before (depending on the import):
or
Now:
|
Modified
| Example of the updated code:
CODE
CODE
CODE
|
Modified
| Overriding of |
Modified
|
|
Modified
| There are no ways to disable one warning on page flushing. |
Sign module
Breaking change | Upgrade path |
---|---|
Renamed | |
Changed
|
CODE
|
Removed | Use |
Removed | Code sample with OCSP response validation:
CODE
|
Removed | Use |
Removed | Use It is possible to set other appearance related properties such as Page, rectangle and other properties could be also set up via For default appearance use
CODE
|
Modified
| Instead:
Example:
CODE
|
Removed | Set these properties to |
Moved Moved Moved all constants from |
Forms module
Breaking change | Upgrade path |
---|---|
Modified
| Instead of |
Modified
| Use |
Removed | Use |
Removed | Could be replaced by Also useful check:
CODE
|
Removed | Instead of
CODE
use
CODE
|
Modified
| Instead of Instead of |
Now choice fields (list boxes and combo boxes) and text fields with |
Pdfa module
Breaking change | Upgrade path |
---|---|
Modified | These methods are implemented in the inheritors of the |
| Use |
| Use new single |
Layout module
Breaking change | Upgrade path |
---|---|
Modified | Use |
Removed | Use |
Removed deprecated | Use |
Removed | Use |
Removed | Use |
Changed default FontSelectorStrategy from | To use FirstMatchStrategy:
CODE
|
Modified
| Instead of |
Modified `com.itextpdf.layout.properties.Property`:
|
|
Io module
Breaking change | Upgrade path |
---|---|
Removed all the deprecated methods in the | Most of the methods are deprecated in favour of |
Removed | Use |
Removed | Use |
Internal class |
Licensekey
Breaking change | Upgrade path |
---|---|
Removed | Use |
Removed some exception and log message constants, e.g.
| Use
|
Html2Pdf
Breaking change | Upgrade path |
---|---|
Removed from
| Use
|
Removed deprecated overloads for | Use |
Removed the following HtmlLogMessageConstants:
These log messages can be replaced by using the equivalent ones from StyledXmlParserLogMessageConstant which contain the same message. | Instead of
use
|
PdfXfa
Breaking change | Upgrade path |
---|---|
Removed | Use |
Removed Deprecated | Use |
PdfOcr
Breaking change | Upgrade path |
---|---|
Modified | Implement depending on whether tagging is supported by OCR engine. |