iText7 Generated PDF Style and Font

michelhanna
Kilo Guru

Hi,

It is also known that the generated PDF do not respect html styling like fonts. And this was mainly due to using iText5.

I am using code in this KB KB0866613 to generate a PDF from a record using the new API sn_pdfgeneratorutils.PDFGenerationAPI().

But now that Paris release supports iText7 via the HR system property sn_hr_core.itext7.pdf_conversion (check here), is there a way to enable iText7 without having the HR module enabled?

In another word, how can we style PDF body with different fonts in Paris?

Thanks! 

3 REPLIES 3

oleg7
Tera Contributor

Have you found a solution to this? I'm trying to generate PDF with Arial as a main font, but don't know what parameter to pass to sn_pdfgeneratorutils.PDFGenerationAPI()

Hi!

I have the same problem too. Looking in Style here:

https://docs.servicenow.com/bundle/rome-application-development/page/app-store/dev_portal/API_refere...

There is no function to call to set the font like "Arial", "Times New Roman" or whatever.

Did you find a solution?


Regards,

Callum Ridley1
Tera Guru

I've just posted an article on the usage of the PDFGenerationAPI, maybe this will help you out

https://community.servicenow.com/community?id=community_article&sys_id=2e2e69d71bdaa0d038739979b04bc...