简体   繁体   中英

Paragraph written from right to left

Is there is a way to tell an iText paragraph contents to write from right to left?

I know it can be done with ColumnText or a table, but I need it in a paragraph (multiple pages can be written).

Here is just an example.

Document document = new Document(PageSize.A1.rotate(), 20, 20, 20, 20);
document.addTitle("YourReport");
PdfWriter writer = PdfWriter.getInstance(document,
        new FileOutputStream("c:\\ITextTest.pdf"));
document.open();            
Paragraph TitleHeading = new Paragraph(targetFileName);
TitleHeading.setAlignment(writer.RUN_DIRECTION_RTL);            
document.add(TitleHeading);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM