Package org.docx4j.model.fields.merge

Examples of org.docx4j.model.fields.merge.DataFieldName


   
    List<Map<DataFieldName, String>> data = new ArrayList<Map<DataFieldName, String>>();

    // Instance 1
    Map<DataFieldName, String> map = new HashMap<DataFieldName, String>();
    map.put( new DataFieldName("KundenNAme"), "Daffy duck");
    map.put( new DataFieldName("Kundenname"), "Plutext");
    map.put(new DataFieldName("Kundenstrasse"), "Bourke Street");
    // To get dates right, make sure you have docx4j property docx4j.Fields.Dates.DateFormatInferencer.USA
    // set to true or false as appropriate.  It defaults to non-US.
    map.put(new DataFieldName("yourdate"), "15/4/2013")
    map.put(new DataFieldName("yournumber"), "2456800");
    data.add(map);
       
    // Instance 2
    map = new HashMap<DataFieldName, String>();
    map.put( new DataFieldName("Kundenname"), "Jason");
    map.put(new DataFieldName("Kundenstrasse"), "Collins Street");
    map.put(new DataFieldName("yourdate"), "12/10/2013");
    map.put(new DataFieldName("yournumber"), "1234800");
    data.add(map);   
   
   
    if (mergedOutput) {
      /*
 
View Full Code Here


 

  public static void main(String[] args) throws Exception {
   
    Map<DataFieldName, String> map = new HashMap<DataFieldName, String>();
    map.put( new DataFieldName("bm1"), "whale shark");
   

    WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage
        .load(new java.io.File(System.getProperty("user.dir")
            + "/bm1.docx"));
View Full Code Here

   
    for (CTBookmark bm : rt.getStarts()) {
     
      // do we have data for this one?
      if (bm.getName()==null) continue;
      String value = data.get(new DataFieldName(bm.getName()));
      if (value==null) continue;
       
      try {
        // Can't just remove the object from the parent,
        // since in the parent, it may be wrapped in a JAXBElement
View Full Code Here

TOP

Related Classes of org.docx4j.model.fields.merge.DataFieldName

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.