NoClassDefFoundError when adding new font in iText on AppEngine

后端 未结 1 404
自闭症患者
自闭症患者 2021-01-27 22:03

I have an appengine java project that includes pdf creation at some point. The pdf document has special font that I\'m trying to include with: BaseFont bf = BaseFont.creat

相关标签:
1条回答
  • 2021-01-27 22:54

    As you know, you should avoid all file system related operations on GAE. As you can read on the iTextG page, some methods in iTextG are to be used only on Android, not on GAE. I quote:

    We have not removed them since they are useful on an Android device, but it doesn't make sense to use them in the context of Google App Engine.

    This means that you need to use a byte[] if you want to create a BaseFont instance. You can't use the createFont() method that takes a path to a font program. Instead you need to use the createFont() method that accepts the bytes of the font program.

    0 讨论(0)
提交回复
热议问题