Results 1 to 5 of 5
  1. #1
    manoj is offline Member
    Join Date
    Jun 2013
    Posts
    3
    Rep Power
    0

    Question creating PDF in multiple languages

    Hi
    I need create PDF file which have multiple languages. I have a java string which contains multiple languages (like English , hindhi and kannada) . I am using Itext jars for converting PDF , But i am unable to get another languages in PDF file except English.Can Any one suggest me which should i use . Which tools are recommended to convert PDF which having multiple languages.

    Thanks & Regards,
    S.Manoj Kumar,
    Moderator edit: phone number removed.
    Last edited by DarrylBurke; 06-28-2013 at 09:13 AM. Reason: Removed phone number

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: creating PDF in multiple languages

    Maybe you just need to set a font which has glyphs for the characters. Or have you already tried that?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: creating PDF in multiple languages

    Please go through the Forum Rules, particularly the second paragraph. The other thread you started has been closed.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    manoj is offline Member
    Join Date
    Jun 2013
    Posts
    3
    Rep Power
    0

    Default Re: creating PDF in multiple languages

    This is the program i used for creating PDF using Itext jars . "data" is variable contains Kannada plus English . I am not getting Kannada text in generated PDF file.

    Program :- (JSP file)
    ========

    <%@page import="java.util.Date"%>
    <%@page import="java.text.DateFormat"%>
    <%@page import="java.text.SimpleDateFormat"%>
    <%@page import="java.util.ArrayList"%>
    <%@page import="java.util.StringTokenizer"%>
    <%@page import="com.itextpdf.text.Document"%>
    <%@page import="com.itextpdf.text.DocumentException"%>
    <%@page import="com.itextpdf.text.List"%>
    <%@page import="com.itextpdf.text.Paragraph"%>
    <%@page import="com.itextpdf.text.pdf.PdfWriter"%>
    <%@page import="java.io.*" %>
    <%@page import="com.itextpdf.text.html.simpleparser.HTMLWo rker"%>
    <%@page import="com.itextpdf.text.pdf.PdfReader"%>
    <%@page import="com.itextpdf.text.pdf.PdfImportedPage"%>
    <%@page import="com.itextpdf.text.Image"%>
    <%@page import="com.itextpdf.text.*"%>
    <%@page import="com.itextpdf.text.Chunk"%>
    <%@page import="java.util.TimeZone"%>
    <%@page import="com.itextpdf.text.log.SysoLogger"%>
    <%
    String data="ಮನೋಜ್<div>---------</div><br><br><br><table border='1'><tr><td>111</td><td>222</td><td>3333</td></tr><tr><td>111</td><td>222</td><td>3333</td></tr><tr><td>111</td><td>222</td><td>3333</td></tr><tr><td>111</td><td>222</td><td>3333</td></tr></table>";
    String fileName="form.pdf";
    try
    {
    response.setContentType("application/pdf");
    response.setHeader("Content-disposition","inline; filename=" + fileName);
    Document document = new Document();
    out.clear(); // where out is a JspWriter (java - getOutputStream() has already been called for this response - Stack Overflow)
    out = pageContext.pushBody();
    PdfWriter.getInstance(document, response.getOutputStream());
    document.open();
    HTMLWorker hw = new HTMLWorker(document);
    hw.parse(new StringReader(data));
    document.close();
    }
    catch (Exception e)
    {
    e.printStackTrace();
    }

    %>
    <%=data %>

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: creating PDF in multiple languages

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Easier way of creating multiple buttons
    By alexix in forum New To Java
    Replies: 6
    Last Post: 04-21-2013, 12:54 PM
  2. Replies: 0
    Last Post: 08-15-2011, 09:23 PM
  3. Replies: 2
    Last Post: 01-05-2011, 10:30 PM
  4. How to support multiple languages?
    By bhupal4all in forum New To Java
    Replies: 2
    Last Post: 09-05-2008, 09:58 AM
  5. Calendar with multiple languages
    By Marcus in forum Web Frameworks
    Replies: 1
    Last Post: 06-27-2007, 04:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •