Hi
I am suing hte Asposer.words jar(latest one) and i have following code.
if (request.getParameter("type").equalsIgnoreCase("pdf")) {
response.setContentType("application-x/msword");
response.setHeader("Content-Disposition", "attachment;filename="
+ "ReportIssuance" + ".pdf");
}
InputStream in = new ByteArrayInputStream(
report != null ? report.getReportData() : new byte[2000]);
ServletOutputStream outStream = response.getOutputStream();
Document doc = new Document(in);
if (request.getParameter("type").equalsIgnoreCase("word"))
doc.save(outStream, SaveFormat.DOC);
if (request.getParameter("type").equalsIgnoreCase("pdf"))
doc.saveToPdf(0, doc.getPageCount(), outStream, null);
if (request.getParameter("type").equalsIgnoreCase("html"))
doc.save(outStream, SaveFormat.HTML);
outStream.flush();
outStream.close();
this reads pdf file, which was stored from UI to DB as byte[]. when i try to read back those byte[] as pdf, i get the following exception.
Caused by: java.lang.IllegalStateException: java.nio.charset.UnsupportedCharsetException: UTF-7