Hello Seiji.

What it means "character is not encoded correctly"? If PDF content is unreadable, then that's PDF file problem, not Tomcat. Is this PDF opens correctly by itself, i.e. when you open it through Adobe Reader?
Anyway, just do response.setContentType("application/pdf") and let browser open it accordingly.


seiji takegata wrote:

I'm trying to generate PDF document directory from JSP using itext library. I have an encoding problem.

I put pageEncoding and contentType attributes in page directive as:

<%@ page contentType="application/pdf"%>
<%@ page pageEncoding="Shift_JIS"%>

Then tomcat (or jasper) translates them like:

response.setContentType("application/pdf;charset=Shift_JIS");

IE will not open AdobeReader, show download dialog instead.

If I do not specify pageEncoding, then the line above will be:

response.setContentType("application/pdf");

AdobeReader opens as I expect. But character is not encoded correctory.

I wonder why "charset=Shift_JIS" is added to contentType string.
I want remove it from the contentType string, or remove whole the line. I think I can specify contentType by


response.setCotentType("application/pdf");



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to