Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-13-2009, 09:12 AM
Member
 
Join Date: Apr 2009
Posts: 1
Rep Power: 0
gautamn is on a distinguished road
Default Fedora Itext Unicode Problem
Hi,
i am printing pdf documents in Indic languages using unicode technology with the following code.

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();


}

}


The code works fine for windows but gives a blank document on Fedora. I have tested the code with several unicode fonts present on Fedora.
My version of Fedora is 9.0.
Kindly help.
regards,
Nitin
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
iText 2.0.4 levent Java Announcements 1 01-25-2010 12:22 PM
How to construct checkbox in rtf document using iText? soumyanil Advanced Java 0 07-28-2008 12:05 PM
To run Netbeans on Linux Fedora 8 rorootot NetBeans 11 07-22-2008 05:23 AM
iText 2.1.0 Java Tip Java Announcements 0 03-29-2008 02:05 PM
Unicode problem rovshanb Database 0 02-14-2008 07:41 AM


All times are GMT +2. The time now is 10:57 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org