0
我想要一点后R字转换为PDF与阿拉伯字母, & DI决定使用使用阿拉伯语和波斯语中XWPFDocument
org.apache.poi.xwpf.converter.pdf.PdfConverter
但是当我写下面的代码时,最后的结果是从左到右,例如对于“سعید”导致pdf是混乱的单词是“سعید”我的docx非常大而不是一个段落:
public class ConvertWord {
public static void ConvertToPDF(String docPath, String pdfPath) {
try {
InputStream doc = new FileInputStream(new File(docPath));
XWPFDocument document = new
PdfOptions options = PdfOptions.create();
options.fontEncoding("UTF-8")
OutputStream out = new FileOutputStream(new File(pdfPath));
PdfConverter.getInstance().convert(document,out,options);
} catch (FileNotFoundException ex) {
} catch (IOException ex) {
}
}
public static void main(String[] args) {
ConvertWord cwoWord=new ConvertWord();
cwoWord.ConvertToPDF("D://" + "usc.docx","D://test12.pdf");
}
}
您提供哪些图书馆支持波斯语? –
说实话,我没有使用它们中的任何一个,但是,通过他们的API很容易,并且检查哪一个提供了这样的右侧布局或类似的东西。 –