简体   繁体   English

从右至左写的段落

[英]Paragraph written from right to left

Is there is a way to tell an iText paragraph contents to write from right to left? 有没有办法告诉iText段落内容从右向左书写?

I know it can be done with ColumnText or a table, but I need it in a paragraph (multiple pages can be written). 我知道可以用ColumnText或表来完成,但是我需要在一个段落中(可以写多个页面)。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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