Stack Exchange
WordtoPdf /PdftoWord in Android
Anyone Know the code for converting  Word to PDF / PDF to Word in ANDROID...
      If you Know 
      Please Share me....
Already tried:
Jars:

docx4j-3.0.0.jar

Code:
    try
    {

        long start = System.currentTimeMillis();

        InputStream is = new FileInputStream(
                new File("file1"));

        Toast.makeText(getApplicationContext(), "is", Toast.LENGTH_SHORT).show();


        WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage
                .load(is);

        List sections = wordMLPackage.getDocumentModel().getSections();

        for (int i = 0; i < sections.size(); i++) {

            System.out.println("sections Size" + sections.size());
          /*  wordMLPackage.getDocumentModel().getSections().get(i)
                    .getPageDimensions().setHeaderExtent(3000);*/
        }

        Mapper fontMapper = new IdentityPlusMapper();

        PhysicalFont font = (PhysicalFont) PhysicalFonts.getPhysicalFonts().get(
                "Comic Sans MS");

        fontMapper.getFontMappings().put("Algerian", font);

        wordMLPackage.setFontMapper(fontMapper);
        PdfSettings pdfSettings = new PdfSettings();
        org.docx4j.convert.out.pdf.PdfConversion conversion = new org.docx4j.convert.out.pdf.viaXSLFO.Conversion(
                wordMLPackage);

       OutputStream out = new FileOutputStream(new File(
                "file1/sampleeee.pdf"));
        conversion.output(out, pdfSettings);



        System.err.println("Time taken to Generate pdf  "
                + (System.currentTimeMillis() - start) + "ms");

    }
    catch(Exception e)
    {
        e.printStackTrace();
    }

But I cant get the output...

related - http://stackoverflow.com/questions/3022376/how-to-convert-ms-doc-to-pdf

One reason why you "cant get the output" is because you are providing an incorrect FileOutputStream. You need to be using either:

Internal storage (openOutputStream(), getFilesDir(), etc.), or
External storage (getExternalFilesDir(), etc.)


k..leave what I have tried...If you know the code to convert Word to Pd f  and Pd f to Word ...Please Share me...
