Hi,
  I am creating PDF with indian languages (using unicode) on Fedora. The
same code works fine for windows, but in linux it shows a blank document.

import java.awt.Font;
import java.awt.Graphics2D;
import java.io.FileOutputStream;

import com.lowagie.text.Document;
import com.lowagie.text.PageSize;
import com.lowagie.text.pdf.PdfContentByte;
import com.lowagie.text.pdf.PdfWriter;


public class HindiText {
        
        public static void main(String[] args){
                
                Document document = new Document();
                  try {
                      PdfWriter writer =
                          PdfWriter.getInstance(document,
                              new FileOutputStream("Shanti.pdf"));
                      document.open();
                      PdfContentByte cb = writer.getDirectContent();
                      Graphics2D graphics2D = cb.createGraphicsShapes(
                              PageSize.A4.getWidth(), PageSize.A4.getHeight());
                      
                    
                      Font font= new java.awt.Font("Lohit Hindi",
                      java.awt.Font.PLAIN, 10); 
                    graphics2D.setFont(font);
                    String text = "Text:\u0936\u093e\u0902\u0924\u093f";
                    graphics2D.drawString(text, 36, 54);
                    graphics2D.dispose();
                } catch (Exception e) {
                    System.err.println(e.getMessage());
                }
                document.close();
        }
}

I have already tested the code with several unicode fonts.
Kindly help,
regards,
Nitin
-- 
View this message in context: 
http://www.nabble.com/PDF-not-created-on-FEDORA-tp23018276p23018276.html
Sent from the iText - General mailing list archive at Nabble.com.


------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to