HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › Troubleshooting › Problem with internet explorer and special characters

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #26408

    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:

    //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….

Viewing 1 post (of 1 total)

The forum ‘Troubleshooting’ is closed to new topics and replies.