iText 5 PDF Generator deprecation

Chad7
Tera Expert

Got an email regarding iText5 PDF generator being deprecated and that we need to make sure all references are updated to iText 7. The Rome release notes say, "Starting with the Rome release, itext version 5 is made inactivate. You must manually upgrade to itext version 7."

Sure. Great. How?

 

3 REPLIES 3

Maik Skoddow
Tera Patron
Tera Patron

Well that certainly contains a lot of info about iText 7, but not what my question was about.

Hi

in my opinion the Support article (see https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0866613) which is referenced by the mentioned article contains everything you need.

There is even an example for which legacy source code you have to replace to use the new API:

  1. Old PDF generation plugin is used to generate PDF has following syntax -
    new GeneralFormAPI (fileName, targetTable, targetTableSysId);
    GeneralFormAPI.setDocument(headerImage, footerImage, footnote, headerPosition, footerPosition, pageSize);
    GeneralFormAPI.createPDF(body);
  2. Where as new API which can be used from Paris version -
    new sn_pdfgeneratorutils.PDFGenerationAPI().convertToPDFWithHeaderFooter(“HTML body”, “TargetTableName”, “TargetSYSID”, “DesiredTargetFileName”,map);

 

Let me know if you have further questions.

Kind regards
Maik