10 Replies Latest reply: Apr 6, 2010 4:16 PM by 843810 RSS

    Multilangual PDF Creation(in all indian languages)

    843810
      We have a module to generate PDF documents, which has to be processed by another module for some security features. Currently we are using iText API to create PDF documents in case of English. But we have to implement i18n in our application ( for all Indian languages). So we need to generate the PDF document in other Indian languages like Hindi, Guajarati, Kannada etc. Following are some criteria to be considered.

      1. The document may have more than one language texts with English texts.
      2. The document may contain all the numeric of all languages and special characters.
      3. We are storing data in database as UNICODE(UTF-8) and using the JDBC API to retrieve.

      Kindly suggest us some solution with iText API. Let us know if some other PDF API is supporting all Indian languages.
        • 1. Re: Multilangual PDF Creation(in all indian languages)
          DrClap
          And is there a problem with that? It's kind of hard to suggest a solution if no problem has been stated.
          • 2. Re: Multilangual PDF Creation(in all indian languages)
            843810
            We are using iText to embed the font which supports Hindi (Indian language) as

            BaseFont.createFont("gargi.ttf",BaseFont.IDENTITY_H, BaseFont.EMBEDDED);

            But still pdf displays different text than expected.We got all the hindi characters, but not in proper format…

            For ex: It displays text as shown in the link provided(hinadi) bellow, instead of हिन्दी (Hindi).
            Note : The text हिन्दी (hindi) is stored in oracle DB in UTF-8 encoding.
            We are able retrieve the same in the browser but not in pdf generated using iText.
            When the iText is embedding, it is getting changed.

            [http://doc-08-8o-docs.googleusercontent.com/docs/secure/rb76hs62dof3nkvdingba5cedl9ltjag/k4vor46pldqqnlarqlogg1qc0jqh594o/1270080000000/00409798775290637475/*/0ByYDS0mupIdzZjhjZTdlZTUtZjZmYy00OGJiLTllYjgtYTJjMWZmNjUxZTY5]
            • 3. Re: Multilangual PDF Creation(in all indian languages)
              DrClap
              Satish.napster wrote:
              We are using iText to embed the font which supports Hindi (Indian language) as

              BaseFont.createFont("gargi.ttf",BaseFont.IDENTITY_H, BaseFont.EMBEDDED);

              But still pdf displays different text than expected.We got all the hindi characters, but not in proper format…
              Okay, that's a more useful problem description. Have you been able to get other methods of PDF creation (e.g. Adobe Acrobat) to produce the proper format? I ask because the problem might be in how Acrobat Reader displays the data and not in how you produce the PDF.
              • 4. Re: Multilangual PDF Creation(in all indian languages)
                843810
                I checked the pdf file with google doc and Ubuntu OS. But found the same problem..
                • 5. Re: Multilangual PDF Creation(in all indian languages)
                  DrClap
                  So problem solved then?
                  • 6. Re: Multilangual PDF Creation(in all indian languages)
                    843810
                    No problem is not solved yet. Can we go for any other API instead of trying various possibilities in iText?
                    • 7. Re: Multilangual PDF Creation(in all indian languages)
                      DrClap
                      So, you tried creating the file with Adobe Acrobat, and then you looked at the result, and you still didn't get the font effect that you wanted? In that case I don't see that you have much hope of doing better than Acrobat can.

                      Or did you ignore my suggestion completely? In that case I don't have anything else to say. Why bother?

                      Your other option is to try asking questions about iText at iText's website.
                      • 8. Re: Multilangual PDF Creation(in all indian languages)
                        843810
                        Please rectify me, If I tested in a wrong way.

                        1. I created the PDF using the same program and used acrobat reader to open.
                        -- The font problem was there.

                        2. I uploaded the PDF to google docs and opened from there.
                        -- The font problem was there.

                        3. I copied the PDF to Ubuntu 9.10 m/c and opened from there using PDF reader.
                        -- The font problem was there.
                        • 9. Re: Multilangual PDF Creation(in all indian languages)
                          DrClap
                          Yes. You already said that was your problem. I suggested you try something else, to see if what you were trying to do was even possible. (If it isn't possible then it's a waste of time to try to make iText do it, right?) You don't seem to have read the post (actually two posts now) where I made that suggestion. Let me try it a third time. You can take my suggestion or not, I don't care because I'm tired of this thread now.

                          Here it is. Are you ready to read it?

                          Use Adobe software to create a PDF file with those characters. Then see if it displays the way you want to use it.

                          Note that I suggested using Adobe software to create the PDF. We already know that what you tried with other software didn't work. So try using Adobe software to see if that works.
                          • 10. Re: Multilangual PDF Creation(in all indian languages)
                            843810
                            Sorry for the misunderstanding..

                            It works there..