Source Code : Rendering text from right to left
Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com.
Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com.
Click Here or search from google with Libraries Name you get jar file related it
Rendering text from right to left

import java.io.FileOutputStream;
import com.lowagie.text.Chunk;
import com.lowagie.text.Document;
import com.lowagie.text.Element;
import com.lowagie.text.PageSize;
import com.lowagie.text.pdf.ColumnText;
import com.lowagie.text.pdf.PdfContentByte;
import com.lowagie.text.pdf.PdfWriter;
public class RightToLeftPDF {
public static void main(String[] args) {
try {
Document document = new Document(PageSize.A4, 50, 50, 50, 50);
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("RightToLeftPDF.pdf"));
document.open();
PdfContentByte cb = writer.getDirectContent();
ColumnText ct = new ColumnText(cb);
ct.setSimpleColumn(100, 100, 500, 800, 24, Element.ALIGN_LEFT);
ct.setSpaceCharRatio(PdfWriter.NO_SPACE_CHAR_RATIO);
ct.setLeading(0, 1);
ct.setRunDirection(PdfWriter.RUN_DIRECTION_RTL);
ct.setAlignment(Element.ALIGN_CENTER);
ct.addText(new Chunk("ABCD"));
ct.go();
ct.setAlignment(Element.ALIGN_JUSTIFIED);
ct.addText(new Chunk("ABCD"));
ct.go();
ct.setAlignment(Element.ALIGN_CENTER);
ct.addText(new Chunk("ABCD"));
ct.go();
document.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Thank with us