MohamedSaeed / xdocreport

Automatically exported from code.google.com/p/xdocreport
1 stars 0 forks source link

Image is not coming in correct location while converting .docx file to html file #453

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
1.Steps to reproduce the problem

 Hi All,

       I am trying to convert .docx/doc file to html file.The .docx/doc file having images.
I used apache poi API.

For this i wrote my code like this

                      // Load DOCX into XWPFDocument
            InputStream inputIs = new FileInputStream(mydocxfile);
            XWPFDocument document = new XWPFDocument(inputIs);

            // Prepare Html options
            XHTMLOptions options = XHTMLOptions.create();

            // Extract image        

            File imageFolder = new File(mypath)
            options.setExtractor( new FileImageExtractor( imageFolder ) );

            // URI resolver
            options.URIResolver( new FileURIResolver( imageFolder ) );

            // Convert XWPFDocument to HTML     

            OutputStream out = new FileOutputStream(new File(destinationPath));
            XHTMLConverter.getInstance().convert(document, out, options);
                        System.out.println("Generated Html content:" + out.toString()) 

Html content is generated properly,but image is not displaying in correct 
location.

That means .docx file having image at right side,but image is displaying at 
left side in html file.

2.Expection:

           In which position .docx/doc file having image,in that position only i am expecting in html file also.  

Could please help me for solving this issue.

Thanks
Anuradha

Original issue reported on code.google.com by anuradha...@walkingtree.in on 24 Nov 2014 at 3:45