How can I generate Byte array from an ODT file java

匿名 (未验证) 提交于 2019-12-03 01:44:01

问题:

I am trying to generate a PDF from an ODT template file which contain the fields i need to populate.

I wanted to get the byte array of this ODT template which is present in the root folder of my project. My application is in such a way that the byte array is provided to generate the PDF.

Is there any specific method to generate the byte array without losing the properties of the template..?

回答1:

Try this may help you :

URL url = this.getClass().getResource("/your_file"); File templateFile = new File(url.toURI()); org.apache.commons.io.FileUtils.readFileToByteArray(templateFile )


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!