Results 1 to 1 of 1
Thread: Fedora Itext Unicode Problem
- 04-13-2009, 08:12 AM #1
Member
- Join Date
- Apr 2009
- Posts
- 1
- Rep Power
- 0
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
Similar Threads
-
iText 2.0.4
By levent in forum Java SoftwareReplies: 2Last Post: 06-23-2010, 06:41 AM -
How to construct checkbox in rtf document using iText?
By soumyanil in forum Advanced JavaReplies: 0Last Post: 07-28-2008, 11:05 AM -
To run Netbeans on Linux Fedora 8
By rorootot in forum NetBeansReplies: 11Last Post: 07-22-2008, 04:23 AM -
iText 2.1.0
By Java Tip in forum Java SoftwareReplies: 0Last Post: 03-29-2008, 01:05 PM -
Unicode problem
By rovshanb in forum JDBCReplies: 0Last Post: 02-14-2008, 06:41 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks