0

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..?

Philip John
  • 5,275
  • 10
  • 43
  • 68

1 Answers1

0

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 )
Shekhar Khairnar
  • 2,643
  • 3
  • 26
  • 44