PDF Generating Tool Support Forum

HOME   Login   Register    Search




  Subject: Problem with internet explorer and special characters
   PostPosted: 22 Jun 2010, 21:36 
Hi, i'm triying to generate a pdf file from a servlet (a filter-servlet to be specific) the thing is that the html that i'm trying to convert have special characters (á é í ó ú ñ) but they are all in the ISO-8859-1 encoding, when i open the URL with firefox all works ok but when i try to open the url with IE the special characters does not render ok, this is my code:
Code:
//the important part of the code
           PD4ML pd4ml = new PD4ML();

            pd4ml.setPageInsets(new Insets(20, 10, 10, 10));
            pd4ml.setHtmlWidth(800);
            pd4ml.setPageSize(pd4ml.changePageOrientation(PD4Constants.LETTER));
           
            response.setContentType("application/pdf");
            response.setCharacterEncoding("ISO-8859-1");
            pd4ml.enableDebugInfo();
            ByteArrayOutputStream salida = new ByteArrayOutputStream();
           
            pd4ml.render(new StringReader(preProcessPage), salida ,new URL("http://"+
                    request.getServerName()+":"+request.getLocalPort()+
                    this.getFilterConfig().getServletContext().getContextPath()),"ISO-8859-1");
           
            response.setContentLength(salida.size());
           
            response.getOutputStream().write(salida.toByteArray());
            response.getOutputStream().close();

//more code


The weird thing is that the code works perfect in firefox, maybe the problem is the internet explorer or the pdf plugin, any ideas? thanks....



[Reply]     [ 1 post ] 

cron
Copyright ©2004-10 zefer|org. All rights reserved. Bookmark and Share