Skip to main content
Skip table of contents

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 aggregator PdfConformance class which can store both PDF/A and PDF/UA conformance.

    • com.itextpdf.kernel.pdf.PdfAConformanceLevel and PdfUAConformanceLevel classes with constants were replaced by PdfAConformance and PdfUAConformance 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 com.itextpdf.kernel.pdf.canvas.parser.listener.DefaultPdfTextLocation class:

  • DefaultPdfTextLocation(int pageNr, Rectangle rect, String text)DefaultPdfTextLocation(Rectangle rect, String text)

  • Removed public int getPageNumber()

  • Removed public DefaultPdfTextLocation setPageNr(int pageNr)

  • Removed IPdfTextLocation#getPageNumber();

Page number was never properly supported and didn’t have any meaning. So, do not use IPdfTextLocation#getPageNumber(); call.

Changed com.itextpdf.kernel.geom.Point class:

  • Made x and y variable private.

  • Removed setLocation(Point) method.

  • Rename translate method to move.

  • Removed old move method.

  • Removed 3 static methods distanceSq

  • Removed static distance(double, double, double, double) method.

  • Removed copy constructor Point(Point)

  • Working with x and y can be replaced by getX, getY and setLocation methods.

  • setLocation(Point) can be replaced by setLocation(double, double).

  • Instead of translate, use move

  • Instead of move, use setLocation

  • distanceSq methods weren’t used, but they can be replaced with Math.pow(distance, 2)

  • distance(double, double, double, double) can be replaced with non-static Point#distance

  • Point(Point) can be replaced with Point(double, double)

Removed deprecated com.itextpdf.kernel.pdf.PdfAConformanceLevel#getPDFAConformance

Shouldn’t be used

Removed com.itextpdf.kernel.pdf.PdfEncryption#createInfoId(byte[], byte[])

Use com.itextpdf.kernel.pdf.PdfEncryption#createInfoId(byte[], byte[], boolean) with false as the last parameter

Removed com.itextpdf.kernel.utils.PdfMerger#PdfMerger(com.itextpdf.kernel.pdf.PdfDocument, boolean,boolean)

Use com.itextpdf.kernel.utils.PdfMerger#PdfMerger(com.itextpdf.kernel.pdf.PdfDocument, com.itextpdf.kernel.utils.PdfMergerProperties) instead:

CODE
- PdfMerger merger = new PdfMerger(outputDoc, false, true);
+ PdfMerger merger = new PdfMerger(outputDoc, new PdfMergerProperties().setMergeTags(false).setMergeOutlines(true));

Modified com.itextpdf.kernel.pdf.PdfDocumentclass:

  • Removed unused for years checkShowTextIsoConfromance(CanvasGraphicsState, PdfResources)

  • Replaced 4 methods with one checkIsoConformance(IValidationContext)

    • checkIsoConformance(Object, IsoKey)

    • checkIsoConformance(Object, IsoKey, PdfResources, PdfStream)

    • checkIsoConformance(Object, IsoKey, PdfResources, PdfStream, Object)

    • checkIsoConformance()

Use checkIsoConformance(IValidationContext)

Renamed and moved com.itextpdf.kernel.pdf.IsoKey to com.itextpdf.kernel.validation.ValidationType

Also added new PDF_DOCUMENT entry, and rename PAGE to PDF_PAGE

Use com.itextpdf.kernel.validation.ValidationType

Moved com.itextpdf.kernel.utils.IValidationChecker to com.itextpdf.kernel.validation.IValidationChecker.

Also replaced validateDocument and validateObject with validate method.

Use com.itextpdf.kernel.validation.IValidationChecker

Moved com.itextpdf.kernel.utils.ValidationContainerto com.itextpdf.kernel.validation.ValidationContainer.

Also replaced validate(ValidateContext) and validate(Object, IsoKey, PdfResources, PdfStream, Object) with validate(IValidationContext).

Use com.itextpdf.kernel.validation.ValidationContainer

Removed incom.itextpdf.kernel.pdf.tagging.PdfStructTreeRoot
findMcrByMcid(PdfDocument, int)

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 FileNotFoundException, throw an IOException.

Modified com.itextpdf.kernel.pdf.PdfDocumentclass:

  • info and xmpMetadata fields became private.

  • getXmpMetadata methods changed returning type from byte[] to XMPMeta.

Instead of direct accessing info and xmpMetadata or old getXmpMetadata methods, use getXmpMetadataBytes or getXmpMetadata methods.

Modified com.itextpdf.kernel.pdf.PdfDocumentInfo class:

  • Removed constructor PdfDocumentInfo(PdfDocument)

Use another constructor PdfDocumentInfo(PdfDictionary, PdfDocument)

Modified com.itextpdf.kernel.pdf.PdfDocumentInfo class:

  • Protected pdfAConformanceLevel became private.

Instead of direct accessing, use getPdfAConformanceLevel

Modified com.itextpdf.kernel.pdf.tagutils.ITagTreeIteratorHandler:

  • renamed nextElement to processElement

  • added accept method (same functionality as approve in TagTreeIteratorElementApprover)

TagTreeIteratorElementApprover was removed:

  • second parameter for public TagTreeIterator(IStructureNode tagTreePointer, TagTreeIteratorElementApprover approver, TreeTraversalOrder traversalOrder) was removed

Implement accept method to check whether the element should be traversed, it should have the same functionality as approve in TagTreeIteratorElementApprover; processElement has the same functionality as nextElement.

For TagTreeIterator use public TagTreeIterator(IStructureNode tagTreePointer, TreeTraversalOrder traversalOrder) instead of the one with TagTreeIteratorElementApprover, and add handlers with implemented accept method.

Modified com.itextpdf.kernel.pdf.PdfPage:

  • hid the public boolean isPageRotationInverseMatrixWritten()

  • hid the public void setPageRotationInverseMatrixWritten()

These methods are for internal usage only (that’s why they moved to PageContentRotationHelper class), and shouldn’t be used by the user.

Modified com.itextpdf.kernel.pdf.PdfDocument:

  • method getConformanceLevel was renamed to getConformance and returned type changed from IConformanceLevel to PdfConformance and always not null instance is returned.

Modified com.itextpdf.kernel.pdf.PdfReader:

  • method getPdfAConformanceLevel was renamed to getPdfConformance, returned type changed from PdfAConformanceLevel to PdfConformance. The method reads both PDF/A and PDF/UA conformance.

Propagated the inner PdfShading classes into seperate independent class files, as well as renamed the base class.

  • renamed PdfShading → AbstractPdfShading

  • ShadingType → contains the constants

  • The inner classes for each shading type now have their own independent classes;

    • PdfShading.Axial → PdfAxialShading

    • PdfShading.CoonsPatch → PdfCoonsPatchShading

    • PdfShading.FreeFormGouraudShadedTriangle → PdfFreeFormGouraudShadedTriangleShading

    • PdfShading.FunctionBased → PdfFunctionBasedShading

    • PdfShading.LatticeFormGouraudShadedTriangle → PdfLatticeFormGouraudShadedTriangleShading

    • PdfShading.Radial → PdfRadialShading

    • PdfShading.TensorProductPatch → PdfTensorProductPatchShading

Before (depending on the import):

PdfShading.Radial radialShading = new PdfShading.Radial(new Cmyk(), shadingVector, stitchingFunction);

or

Radial radialShading = new Radial(new Cmyk(), shadingVector, stitchingFunction);

Now:

PdfRadialShading radialShading = new PdfRadialShading(new Cmyk(), shadingVector, stitchingFunction);

Modified com.itextpdf.kernel.events:

  • removed IEventDispatcher and EventDispatcher

  • com.itextpdf.kernel.events.IEventHandler renamed and moved to com.itextpdf.kernel.pdf.event.AbstractPdfDocumentEventHandler

  • com.itextpdf.kernel.events.Event renamed and moved to com.itextpdf.kernel.pdf.event.AbstractPdfDocumentEvent

  • com.itextpdf.kernel.events.PdfDocumentEvent moved to com.itextpdf.kernel.pdf.event.PdfDocumentEvent

PdfDocument related changes:

  • PdfDocument#dispatchEvent(com.itextpdf.kernel.events.Event event, boolean delayed) was removed

  • PdfDocument#hasEventHandler(String type) replaced by hasEventHandler(AbstractPdfDocumentEventHandler handler)

  • PdfDocument#removeEventHandler(String type, com.itextpdf.kernel.events.IEventHandler handler) replaced by removeEventHandler(AbstractPdfDocumentEventHandler handler)

Example of the updated code:

  • Extend your handler from AbstractPdfDocumentEventHandler instead of implementing com.itextpdf.kernel.events.IEventHandler:

CODE
- class ParagraphAdderHandler implements IEventHandler
+ ParagraphAdderHandler extends AbstractPdfDocumentEventHandler
  • Override onAcceptedEvent (event that came here was already filtered by type and document) instead of handleEvent:

CODE
   @Override
-  public void handleEvent(Event event) {
+  public void onAcceptedEvent(AbstractPdfDocumentEvent event) {
  • Modify imports:

CODE
- import com.itextpdf.kernel.events.Event;
- import com.itextpdf.kernel.events.IEventHandler;
- import com.itextpdf.kernel.events.PdfDocumentEvent;
+ import com.itextpdf.kernel.pdf.event.AbstractPdfDocumentEventHandler;
+ import com.itextpdf.kernel.pdf.event.AbstractPdfDocumentEvent;
+ import com.itextpdf.kernel.pdf.event.PdfDocumentEvent;

Modified com.itextpdf.kernel.pdf.PdfDocument:

  • Removed protected markObjectAsMustBeFlushed and flushInfoDictionary methods, they were methods for internal usage only.

  • Removed protected addCustomMetadataExtensions method.

Overriding of addCustomMetadataExtensions can be replaced with getXmpMetadataBytes overriding.

Modified com.itextpdf.kernel.pdf.WriterProperties:

  • Removed addUAXmpMetadata method.

addUAXmpMetadata can be replaced by addPdfUaXmpMetadata(PdfUAConformance)

Modified com.itextpdf.pdfua.PdfUADocument:

  • Removed disablePageFlishingWarning.

There are no ways to disable one warning on page flushing.

Sign module

Breaking change

Upgrade path

Renamed com.itextpdf.signatures.validation.v1 package to com.itextpdf.signatures.validation

Changed com.itextpdf.signatures.validation.ValidatorChainBuilder to create new instances using java.util.function.Supplier:

  • withCRLValidator(CRLValidator) method is replaced by withCRLValidatorFactory(Supplier<CRLValidator>)

  • withDocumentRevisionsValidator(DocumentRevisionsValidator) –> withDocumentRevisionsValidatorFactory(Supplier<DocumentRevisionsValidator>)

  • withOCSPValidator(OCSPValidator) –> withOCSPValidatorFactory(Supplier<OCSPValidator>)

  • withRevocationDataValidator(RevocationDataValidator) –> withRevocationDataValidatorFactory(Supplier<RevocationDataValidator>)

  • withCertificateChainValidator(CertificateChainValidator) –> withCertificateChainValidatorFactory(Supplier<CertificateChainValidator>)

  • withIssuingCertificateRetriever(IssuingCertificateRetriever) –> withIssuingCertificateRetrieverFactory(Supplier<IssuingCertificateRetriever>)

CODE
  new ValidatorChainBuilder()
-            .withIssuingCertificateRetriever(certificateRetriever)
+            .withIssuingCertificateRetrieverFactory(() -> certificateRetriever)

Removed com.itextpdf.signatures.CertificateUtil#getCrl and getCRLURL

Use com.itextpdf.signatures.CertificateUtil#getCrls and getCRLURLs instead (and .get(0) for the exact same result).

Removed com.itextpdf.signatures.OcspClientBouncyCastle(OCSPVerifier verifier) constructor

Code sample with OCSP response validation:

CODE
OcspClientBouncyCastle ocspClientBouncyCastle = new OcspClientBouncyCastle();

IBasicOCSPResp basicOCSPResp = ocspClientBouncyCastle.getBasicOCSPResp(checkCert, rootCert, ocspServiceUrl);

ValidationReport report = new ValidationReport();
ValidatorChainBuilder validatorChainBuilder = new ValidatorChainBuilder()
        .withSignatureValidationProperties(new SignatureValidationProperties())
        .withIssuingCertificateRetrieverFactory(()-> new IssuingCertificateRetriever());

OCSPValidator validator = validatorChainBuilder.buildOCSPValidator();
validator.validate(report, new ValidationContext(ValidatorContext.REVOCATION_DATA_VALIDATOR,
        CertificateSource.SIGNER_CERT, TimeBasedContext.PRESENT), checkCert, basicOCSPResp.getResponses()[0], basicOCSPResp,
        TimeTestUtil.TEST_DATE_TIME, TimeTestUtil.TEST_DATE_TIME);
Assertions.assertEquals(ValidationReport.ValidationResult.VALID, report.getValidationResult());

Removed com.itextpdf.signatures.DigestAlgorithms#digest(java.io.InputStream, java.lang.String, com.itextpdf.signatures.IExternalDigest)

Use com.itextpdf.signatures.DigestAlgorithms#digest(java.io.InputStream, java.security.MessageDigest) instead.
You could get java.security.MessageDigest using com.itextpdf.signatures.IExternalDigest#getMessageDigest(java.lang.String)

Removed com.itextpdf.signatures.PdfSignatureAppearance class in favour of com.itextpdf.forms.form.element.SignatureFieldAppearance

Use com.itextpdf.signatures.SignerProperties#setSignatureAppearance(com.itextpdf.forms.form.element.SignatureFieldAppearance) and com.itextpdf.signatures.PdfSigner#setSignerProperties to customize signature appearance. The examples could be found here: [java] and [dotnet].

It is possible to set other appearance related properties such as PdfSignatureFormField#setReuseAppearance, PdfSignatureFormField#setBackgroundLayer (n0 layer) and PdfSignatureFormField#setSignatureAppearanceLayer (n2 layer) for the signature field using PdfSigner#getSignatureField():

Page, rectangle and other properties could be also set up via SignerProperties.

For default appearance use new SignatureFieldAppearance(SignerProperties.IGNORED_ID).setContent(new SignedAppearanceText()). You could also set up deprecated rendering modes using appropriate overloads for com.itextpdf.forms.form.element.SignatureFieldAppearance#setContent, e.g. for deleted RenderingMode.GRAPHIC_AND_DESCRIPTION you could use SignatureFieldAppearance#setContent(com.itextpdf.forms.fields.properties.SignedAppearanceText, com.itextpdf.io.image.ImageData), or SignatureFieldAppearance#setContent(java.lang.String, com.itextpdf.io.image.ImageData).

Example: java, .net

CODE
         PdfSigner signer = new PdfSigner(new PdfReader(srcFileName), FileUtil.getFileOutputStream(outFileName), new StampingProperties());

-        signer.setFieldName("Signature1");
+        SignerProperties signerProperties = new SignerProperties()
+                .setFieldName("Signature1»);
+        signer.setSignerProperties(signerProperties);

-        signer.getSignatureAppearance()
-                .setPageRect(new Rectangle(50, 650, 200, 100))
+        SignatureFieldAppearance appearance = new SignatureFieldAppearance(SignerProperties.IGNORED_ID)
+                .setContent("Approval test signature.\nCreated by iText.");
+        signerProperties.setPageRect(new Rectangle(50, 650, 200, 100))
                 .setReason("Test")
                 .setLocation("TestCity")
-                .setLayer2Text("Approval test signature.\nCreated by iText.");
-
+                .setSignatureAppearance(appearance);

Modified com.itextpdf.signatures.PdfSigner:

  • removed NOT_CERTIFIED, CERTIFIED_NO_CHANGES_ALLOWED, CERTIFIED_FORM_FILLING, CERTIFIED_FORM_FILLING_AND_ANNOTATIONS constants

  • removed almost all setters/getters and properties in favour of SignerProperties:

    • public getters and setters:

      • java.util.Calendar getSignDate() and setSignDate(java.util.Calendar signDate)

      • setSignatureAppearance(SignatureFieldAppearance appearance)

      • int getCertificationLevel() and setCertificationLevel(int certificationLevel), setCertificationLevel(AccessPermissions accessPermissions)

      • String getFieldName() and setFieldName(String fieldName)

      • int getPageNumber() and setPageNumber(int pageNumber)

      • Rectangle getPageRect() and setPageRect(Rectangle pageRect)

      • PdfSigFieldLock getFieldLockDict() and setFieldLockDict(PdfSigFieldLock fieldLock)

      • String getSignatureCreator() and setSignatureCreator(String signatureCreator)

      • String getContact() and setContact(String contact)

      • String getReason() and setReason(String reason)

      • String getLocation() and setLocation(String location)

    • protected fields:

      • String fieldName

      • PdfSigFieldLock fieldLock

      • PdfSignatureAppearance appearance

      • Calendar signDate

  • removed public PdfSignatureAppearance getSignatureAppearance() and introduced new protected SignatureFieldAppearance getSignatureAppearance() (shouldn’t be used by the user)

Instead:

  • use com.itextpdf.signatures.AccessPermissions (UNSPECIFIED, NO_CHANGES_PERMITTED, FORM_FIELDS_MODIFICATION, ANNOTATION_MODIFICATION)

  • set up the properties using com.itextpdf.signatures.SignerProperties instance, and then pass that instance either via PdfSigner constructor, or using com.itextpdf.signatures.PdfSigner#setSignerProperties

    • use com.itextpdf.signatures.SignerProperties#setSignatureAppearance to customize signature appearance

    • use setClaimedSignDate or getClaimedSignDate instead of set/getSignDate (note that claimed sign date is /M entry in the signature dictionary, not actual signing date)

    • all the other setters and getters are named the same

Example:

CODE
         PdfSigner signer = new PdfSigner(reader, FileUtil.getFileOutputStream(dest), properties);
 
-        signer.setCertificationLevel(PdfSigner.NOT_CERTIFIED); // Removed
-        signer.setFieldName(name); // Removed
+        SignerProperties signerProperties = new SignerProperties()
+                .setCertificationLevel(AccessPermissions.UNSPECIFIED)
+                .setFieldName(name);
 
         // Creating the appearance
-        PdfSignatureAppearance appearance = signer.getSignatureAppearance(); // Removed
-        appearance.setReason(reason) // Removed
-        signer // Removed
-                .setReuseAppearance(setReuseAppearance) // Removed

+        SignatureFieldAppearance appearance = new SignatureFieldAppearance(SignerProperties.IGNORED_ID)
+                .setContent(new SignedAppearanceText());
+        signerProperties
+                .setReason(reason)
                 .setLocation(location)
                 .setSignatureAppearance(appearance);
         if (rectangleForNewField != null) {
-            signer.setPageRect(rectangleForNewField); // Removed
+            signerProperties.setPageRect(rectangleForNewField);
         }
         if (fontSize != null) {
-            appearance.setLayer2FontSize((float) fontSize); // Removed
+            appearance.setFontSize((float) fontSize);
         }
+        signer.setSignerProperties(signerProperties);
+        // Before getSignatureField call we should set fieldName, page and rectangle
+        signer.getSignatureField().setReuseAppearance(setReuseAppearance);
 
         // Creating the signature
         signer.signDetached(new BouncyCastleDigest(), privateKeySignature, chain, null, null, null, 0, subfilter);

Removed setCertificationLevel(AccessPermissions accessPermissions) and setSignatureFieldLock(PdfSigFieldLock fieldLock) from com.itextpdf.signatures.PdfPadesSigner

Set these properties to com.itextpdf.signatures.SignerProperties used as a parameter in any of the signing methods in PdfPadesSigner (e.g. signWithBaselineBProfile)

Moved com.itextpdf.singatures.DigestAlgorithms class to com.itextpdf.kernel.crypto package.

Moved com.itextpdf.signatures.OID class to com.itextpdf.kernel.crypto package.

Moved all constants from com.itextpdf.singatures.SecurityIDs (with removing ID_ part from the start of names) to com.itextpdf.kernel.crypto.OID class. and removed SecurityIDs.

Forms module

Breaking change

Upgrade path

Modified com.itextpdf.forms.fields.AbstractPdfFormField class:

  • removed getPdfAConformanceLevel method

  • removed pdfAConformanceLevel field

Instead of getPdfAConformanceLevel and pdfAConformanceLevel use getPdfConformanceLevel and pdfConformanceLevel

Modified com.itextpdf.forms.fields.FormFieldBuilder, AbstractFormFieldRenderer, AbstractSelectFieldRenderer classes:

  • removed deprecated getConformanceLevel method

  • renamed getGenericConformanceLevel to getConformanceLevel

  • same for setters in the FormFieldBuilder

Use IConformanceLevel getConformanceLevel(), setConformanceLevel(IConformanceLevel conformanceLevel)

Removed com.itextpdf.forms.form.element.CheckBox#setPdfAConformanceLevel

Use com.itextpdf.forms.form.element.CheckBox#setPdfConformanceLevel

Removed com.itextpdf.forms.form.renderer.CheckBoxRenderer#isPdfA()

Could be replaced by renderer.<IConformanceLevel>getProperty(FormProperty.FORM_CONFORMANCE_LEVEL) instanceof PdfAConformanceLevel

Also useful check:

CODE
boolean isConformantPdfDocument =
        renderer.<IConformanceLevel>getProperty(FormProperty.FORM_CONFORMANCE_LEVEL) != null;

Removed com.itextpdf.forms.form.FormProperty#FORM_ACCESSIBILITY_LANGUAGE

Instead of

CODE
someElement.setProperty(FormProperty.FORM_ACCESSIBILITY_LANGUAGE, "en");

use

CODE
IAccessibleElement accessibleElement = (IAccessibleElement) someElement;
accessibleElement.getAccessibilityProperties().setLanguage("en");

Modified com.itextpdf.forms.form.element.AbstractSelectField:

  • removed deprecated List<IBlockElement> getOptions()

  • renamed getItems to List<SelectFieldItem> getOptions()

  • removed addOption(IBlockElement optionElement)

Instead of getItems use getOptions.

Instead of field.addOption(option) use field.addOption(new SelectFieldItem("option", option)).

Now choice fields (list boxes and combo boxes) and text fields with comb flag are drawn using our layout mechanism, so this is a behavioral breaking change. The background and text color for selected elements in the list box has also changed.

Pdfa module

Breaking change

Upgrade path

Modified com.itextpdf.pdfa.checker.PdfAChecker: made checkSignatureType, checkColor, checkColorSpace, checkCrypto, checkText, checkPageColorsUsages, checkCatalog methods abstract, removed their deprecated analogues as well as checkResources, checkColorsUsages

These methods are implemented in the inheritors of the PdfAChecker

PdfAConformanceException exception message constants were removed

Use PdfaExceptionMessageConstant constants instead

PdfADocument and PdfAChecker were changed because PdfDocument#checkIsoConformance and IValidationChecker#validate methods changed.

Use new single checkIsoConformance and validate methods.

Layout module

Breaking change

Upgrade path

Modified com.itextpdf.layout.font.FontProvider: removed FontSelectorStrategy getStrategy methods

Use IFontSelectorStrategy createFontSelectorStrategy instead

Removed com.itextpdf.layout.font.FontSelectorStrategy

Use com.itextpdf.layout.font.selectorstrategy.IFontSelectorStrategy instead

Removed deprecated com.itextpdf.layout.font.ComplexFontSelectorStrategy

Use com.itextpdf.layout.font.selectorstrategy.FirstMatchFontSelectorStrategy instead

Removed rowspansToDeduct parameter in the com.itextpdf.layout.renderer.TableBorders#buildBordersArrays(CellRenderer cell, int row, int col, int[] rowspansToDeduct) method

Use buildBordersArrays(CellRenderer cell, int row, int col, int[] rowspansToDeduct) instead

Removed com.itextpdf.layout.renderer.MulticolRenderer#createSplitRenderer(List<IRenderer> children)

Use GridMulticolUtil.createSplitRenderer(children, multicolRenderer)

Changed default FontSelectorStrategy from FirstMatchFontSelectorStrategy to BestMatchFontSelectorStrategy

To use FirstMatchStrategy:

CODE
FontProvider sel = new FontProvider();
sel.setFontSelectorStrategyFactory(new FirstMatchFontSelectorStrategyFactory());

Modified com.itextpdf.layout.ElementPropertyContainer class:

  • Renamed setBold to simulateBold

  • Renamed setItalic to simulateItalic

Instead of setBold and setItalic use new simulateBold and simulateItalic methods.

Modified `com.itextpdf.layout.properties.Property`:

  • removed Property.BORDER

  • removed Property.BORDER_RADIUS

  • Instead of Property.BORDER use Property.BORDER_TOP, Property.BORDER_RIGHT, Property.BORDER_BOTTOM and Property.BORDER_LEFT (or e.g. com.itextpdf.layout.ElementPropertyContainer#setBorder).

  • Instead of Property.BORDER_RADIUS use Property.BORDER_BOTTOM_LEFT_RADIUS, Property.BORDER_BOTTOM_RIGHT_RADIUS, Property.BORDER_TOP_LEFT_RADIUS and Property.BORDER_TOP_RIGHT_RADIUS

Io module

Breaking change

Upgrade path

Removed all the deprecated methods in the com.itextpdf.io.font.FontCache

Most of the methods are deprecated in favour of CjkResourceLoader

Removed com.itextpdf.io.font.cmap.CMapContentParser#decodeName

Use PdfNameUtil.decodeName instead

Removed com.itextpdf.io.logs.IoLogMessageConstant#XOBJECT_HAS_NO_STRUCT_PARENTS

Use com.itextpdf.kernel.logs.KernelLogMessageConstant#XOBJECT_STRUCT_PARENT_INDEX_MISSED_AND_RECREATED

Internal class com.itextpdf.io.source.OutputStream is renamed to com.itextpdf.io.source.HighPrecisionOutputStream

Licensekey

Breaking change

Upgrade path

Removed com.itextpdf.licensing.base.util.JsonUtil

Use com.itextpdf.commons.utils.JsonUtil instead

Removed some exception and log message constants, e.g.

  • LicenseKeyLogMessageConstant.UNABLE_TO_DESERIALIZE_STRING

Use

  • CommonsLogMessageConstant.UNABLE_TO_DESERIALIZE_JSON

Html2Pdf

Breaking change

Upgrade path

Removed from com.itextpdf.html2pdf.attach.impl.OutlineHandler:

  • putTagPriorityMapping

  • putAllTagPriorityMappings

  • getTagPriorityMapping

  • hasTagPriorityMapping

Use

  • putMarkPriorityMapping

  • putAllMarksPriorityMappings

  • getMarkPriorityMapping

  • hasMarkPriorityMapping

Removed deprecated overloads for com.itextpdf.html2pdf.attach.util.LinkHelper#applyLinkAnnotation

Use applyLinkAnnotation(IPropertyContainer container, String url, ProcessorContext context, IElementNode element)

Removed the following HtmlLogMessageConstants:

  • DEFAULT_VALUE_OF_CSS_PROPERTY_UNKNOWN

  • QUOTES_PROPERTY_INVALID

  • UNABLE_TO_RESOLVE_COUNTER

  • UNABLE_TO_RETRIEVE_IMAGE_WITH_GIVEN_BASE_URI

These log messages can be replaced by using the equivalent ones from StyledXmlParserLogMessageConstant which contain the same message.

Instead of

HtmlLogMessageConstants.DEFAULT_VALUE_OF_CSS_PROPERTY_UNKNOWN

use

StyledXmlParserLogMessageConstant .DEFAULT_VALUE_OF_CSS_PROPERTY_UNKNOWN

PdfXfa

Breaking change

Upgrade path

Removed tokenNames and getTokenNames from com.itextpdf.tool.xml.xtra.xfa.formcalc.FormCalcLexer

Use com.itextpdf.tool.xml.xtra.xfa.formcalc.FormCalcLexer#VOCABULARY and getVocabulary instead.

Removed tokenNames and related methods from com.itextpdf.tool.xml.xtra.xfa.formcalc.FormCalcParser

Deprecated getTokenNames method shouldn’t be used: it is left only because it is a superclass method that should be overridden.

Use com.itextpdf.tool.xml.xtra.xfa.formcalc.FormCalcParser#VOCABULARY and getVocabulary instead.

PdfOcr

Breaking change

Upgrade path

Modified com.itextpdf.pdfocr.IOcrEngine: added boolean isTaggingSupported()

Implement depending on whether tagging is supported by OCR engine.

JavaScript errors detected

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

If this problem persists, please contact our support.