You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by fatmas1982 <f_...@yahoo.co.uk> on 2013/07/22 10:52:28 UTC

convert arabic docx file to pdf direction error

I want convert arabic docx file to pdf I used     *    try{          
OutputStream out = new FileOutputStream( new File(
"E:\\demoFiles\\word\\ArabicDocxResume2222.pdf" ) );                      
XWPFDocument document =               new XWPFDocument(new FileInputStream(
"E:\\demoFiles\\word\\DocxResume.docx" ) );           PdfOptions options =
PdfOptions.create();                       // Customize Font provider for
Chinese characters           // This code is not optimized (font are not
cached and it works only for windows)           // Chinese people could you
explain us how docx manage chinese characters?          
options.fontProvider( new IFontProvider()           {               public
Font getFont( String familyName, String encoding, float size, int style,
Color color )               {                   try                   {                   
com.lowagie.text.pdf. BaseFont bfArabic =                         
com.lowagie.text.pdf. BaseFont.createFont(
"E:\\FatmaConverter\\Project1\\arial.ttf", BaseFont.IDENTITY_H,
BaseFont.EMBEDDED );                       com.lowagie.text.Font fontArabic
= new com.lowagie.text.Font( bfArabic, size, style, color );                      
if ( familyName != null )                           fontArabic.setFamily(
familyName );                       return fontArabic;                   }                  
catch ( Throwable e )                   {                      
e.printStackTrace();                       // An error occurs, use the
default font provider.                       return
ITextFontRegistry.getRegistry().getFont( familyName, encoding, size, style,
color );                   }               }           } );                      
com.lowagie.text.pdf.BaseFont bf =               
com.lowagie.text.pdf.BaseFont.createFont("E:\\FatmaConverter\\Project1\\arial.ttf",
BaseFont.IDENTITY_H,                                    true);           
float fon=14.0f;            com.lowagie.text.Font font = new
com.lowagie.text.Font(bf,fon);                                               
PdfConverter.getInstance().convert( document, out, options );       
}catch(Exception e){            e.printStackTrace();        }*words
displayed as left to right direction how I can change direction and
alignment docx document includes images also 



--
View this message in context: http://apache-poi.1045710.n5.nabble.com/convert-arabic-docx-file-to-pdf-direction-error-tp5713277.html
Sent from the POI - Dev mailing list archive at Nabble.com.