Creating a PDF file with UTF-8 encoding through Servlet

Hi All,
 
I need to create and return back a PDF file from Servlet as a response to http request (typical download functionality).
 
Now for this purpose I'm -
 
1. First setting following fields in response onject -
 response.setContentType("application/pdf");
  response.setHeader("Pragma", "");
  response.setHeader("Cache-Control", "");
  response.setDateHeader("Expires", 0);
 
2. After that I'm creating an OutputStream object from the response object.
 
3. Using theat OutputStream object I'm wrting the content of the PDF file (using APIs of PDFlib). Using PDFDocument.open(OutputStream) to create the document object.
 
4. After writing the content of the PDF I'm closing the PDF file (PDFDocument.close()).
 
In this context, I'll like to know, don't I need to specify the encoding of the PDF document through the setContentType API ? Say, I'm creating a PDF file with Japanese content and I want the encoding of the file to be of Shift_JIS. 
 
Any pointer/information on thios would be highly appreciated.
 
Regards,
Sourav

 

Received on Friday, 20 May 2005 13:15:02 UTC