2016-12-06 153 views
0

我的問題是使用docx4j當我將docx轉換爲pdf在我的本地它精細顯示英文數字像「」但當我轉換其他機器時,它顯示阿拉伯數字如「0 1 2 3 4 5 6 7 8 9」。顯示阿拉伯數字

大加讚賞, 我的代碼是

String regex = null; 
    PhysicalFonts.setRegex(regex); 

    FOSettings foSettings = Docx4J.createFOSettings(); 
    foSettings.setWmlPackage(wordMLPackage); 

    Docx4J.toFO(foSettings, os, Docx4J.FLAG_NONE); 
    logger.info(" Successfully Convert into PDF "); 
+0

請把你的docx上http://ndoc.it並張貼在這裏的鏈接。如果您在Acrobat中打開PDF,它使用的字體是什麼?本地機器上使用的字體是否安裝在另一臺機器上? – JasonPlutext

+0

https://www.dropbox.com/s/8pxsroimb60jsiz/Information.docx?dl=0我的docx文件鏈接,我檢查過pdf其他機器是相同的字體 – Tariq

回答

0

檢查docx4j.properties:

# These affect the output of numbers in Arabic; see further RunFontSelector 
# For further discussion, please see http://www.docx4java.org/forums/pdf-output-f27/arabic-number-digits-in-pdf-output-t1826.html 
# Value can be 'Context'|'National' 
docx4j.MicrosoftWindows.Region.Format.Numbers.NativeDigits=National 
# Value can be 'Hindi'|'Context'|'Arabic'|'System'; default is Arabic ie 1234 
docx4j.MicrosoftWord.Numeral=Arabic