bellakhalAmir / xdocreport

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

Bullets are not displaying in pdf file while converting .docx file to pdf file. #454

Open GoogleCodeExporter opened 8 years ago

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

   Hi All,

          I am trying to convert .docx file to pdf file.The .docx file having bullets (like selected checkboxes).
Bullets are not displaying in pdf file.For this i am using follwing jars.

fr.opensagres.xdocreport.document:1.0.4
fr.opensagres.xdocreport.template:1.0.4
fr.opensagres.xdocreport.converter:1.0.4
fr.opensagres.xdocreport.converter.docx.xwpf:1.0.4
fr.opensagres.xdocreport.itext.extension:1.0.4
fr.opensagres.xdocreport.core:1.0.4
fr.opensagres.xdocreport.template.velocity:1.0.4
fr.opensagres.xdocreport.document.docx:1.0.4

For this i wrote my code like this

public class DocxProjectWithVelocityList2PDF {

    public static void main(String[] args) {
        try {
            // 1) Load Docx file by filling Velocity template engine and cache
            // it to the registry
            InputStream in = DocxProjectWithVelocityList2PDF.class
                    .getResourceAsStream("DocxProjectWithVelocityList.docx");
            IXDocReport report = XDocReportRegistry.getRegistry().loadReport(
                    in, TemplateEngineKind.Velocity);

            // 2) Create fields metadata to manage lazy loop (#foreach velocity) for table row.
            FieldsMetadata metadata = report.createFieldsMetadata();
            // Old API 
            /*
            metadata.addFieldAsList("developers.Name");
            metadata.addFieldAsList("developers.LastName");
            metadata.addFieldAsList("developers.Mail");
            */
            // NEW API
            metadata.load( "developers", Developer.class, true );

            // 3) Create context Java model
            IContext context = report.createContext();
            // Register project
            Project project = new Project("XDocReport");
            context.put("project", project);
            // Register developers list
            List<Developer> developers = new ArrayList<Developer>();
            developers.add(new Developer("ZERR", "Angelo", "angelo.zerr@gmail.com"));
            developers.add(new Developer("Leclercq", "Pascal", "pascal.leclercq@gmail.com"));
            context.put("developers", developers);

            // 4) Generate report by merging Java model with the Docx
            OutputStream out = new FileOutputStream(new File(
                    "DocxProjectWithVelocityList_Out.pdf"));
            // report.process(context, out);
            Options options = Options.getTo(ConverterTypeTo.PDF).via(
                    ConverterTypeVia.XWPF);
            report.convert(context, options, out);

        } catch (IOException e) {
            e.printStackTrace();
        } catch (XDocReportException e) {
            e.printStackTrace();
        }
    }
}

2.Expection:Bullets should be displayed in the generated pdf file,if the .docx 
file having bullets like selected checkboxes.

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:59