Java Code Examples for org.docx4j.openpackaging.packages.WordprocessingMLPackage#getMainDocumentPart()

The following examples show how to use org.docx4j.openpackaging.packages.WordprocessingMLPackage#getMainDocumentPart() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractInliner.java    From yarg with Apache License 2.0 6 votes vote down vote up
protected Part resolveTextPartForDOCX(Text text, WordprocessingMLPackage wordPackage) {
    java.util.List<SectionWrapper> sectionWrappers = wordPackage.getDocumentModel().getSections();
    for (SectionWrapper sw : sectionWrappers) {
        HeaderFooterPolicy hfp = sw.getHeaderFooterPolicy();
        List<Part> parts = Arrays.asList(hfp.getFirstHeader(), hfp.getDefaultHeader(), hfp.getEvenHeader(),
                hfp.getFirstFooter(), hfp.getDefaultFooter(), hfp.getEvenFooter());
        for (Part part : parts) {
            TextMatchCallback callback = new TextMatchCallback(text);
            new TraversalUtil(part, callback);
            if (callback.matched) {
                return part;
            }
        }
    }
    return wordPackage.getMainDocumentPart();
}
 
Example 2
Source File: HtmlToDOCDemo.java    From docx4j-template with Apache License 2.0 6 votes vote down vote up
public static void replaceRichText(WordprocessingMLPackage wordMLPackage, Map<String, String> richTextMap) throws Docx4JException, JAXBException {
	MainDocumentPart document = wordMLPackage.getMainDocumentPart();
	Map<String, List<Object>> textNodeMap = new HashMap<String, List<Object>>();
	findRichTextNode(textNodeMap, document.getContents().getBody(), null);
	Iterator<String> iterator = richTextMap.keySet().iterator();
	while (iterator.hasNext()) {
		String textTag = iterator.next();
		List<Object> textNodeList = textNodeMap.get(textTag);
		if (textNodeList != null && richTextMap.containsKey(textTag)) {
			List<Object> textObjList = convertToWmlObject(wordMLPackage, richTextMap.get(textTag));
			for (int i = 0, iSize = textNodeList.size(); i < iSize; i++) {
				Object nodeObject = textNodeList.get(i);
				if (nodeObject != null) {
					//setWmlPprSetting(textNodeList.get(i), textObjList);
					TraversalUtil.replaceChildren(nodeObject , textObjList);
				}
			}
		}
	}
}
 
Example 3
Source File: DocxProducer.java    From OfficeProducer with Apache License 2.0 6 votes vote down vote up
/**
 * 创建Docx的主方法
 *
 * @param templatePath        模板docx路径
 * @param parameters          参数和值
 * @param paragraphParameters 段落参数
 * @param imageParameters     书签和图片
 * @return
 */
private static WordprocessingMLPackage CreateWordprocessingMLPackageFromTemplate(String templatePath,
                                                                                 HashMap<String, String> parameters,
                                                                                 HashMap<String, String> paragraphParameters,
                                                                                 HashMap<String, String> imageParameters)
        throws Exception {
    @Cleanup InputStream docxStream = DocxProducer.class.getResourceAsStream(templatePath);
    WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(docxStream);
    MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();

    //第一步 替换字符参数
    if (parameters != null) {
        replaceParameters(documentPart, parameters);
    }

    //第二步 替换段落
    if (paragraphParameters != null) {
        replaceParagraph(documentPart, paragraphParameters);
    }

    //第三步 插入图片
    if (imageParameters != null) {
        replaceBookMarkWithImage(wordMLPackage, documentPart, imageParameters);
    }
    return wordMLPackage;
}
 
Example 4
Source File: WordprocessingMLTemplateWriter.java    From docx4j-template with Apache License 2.0 6 votes vote down vote up
public static void writeToStream(WordprocessingMLPackage wmlPackage,OutputStream output) throws IOException, Docx4JException {
	Assert.notNull(wmlPackage, " wmlPackage is not specified!");
	Assert.notNull(output, " output is not specified!");
	InputStream input = null;
	try {
		//Document对象
		MainDocumentPart document = wmlPackage.getMainDocumentPart();	
		//Document XML
		String documentXML = XmlUtils.marshaltoString(wmlPackage);
		//转成字节输入流
		input = IOUtils.toBufferedInputStream(new ByteArrayInputStream(documentXML.getBytes()));
		//输出模板
		IOUtils.copy(input, output);
	} finally {
		IOUtils.closeQuietly(input);
	}
}
 
Example 5
Source File: WordprocessingMLDocxStAXTemplate.java    From docx4j-template with Apache License 2.0 6 votes vote down vote up
/**
 * 变量替换方式实现(只能解决固定模板的word生成)
 * @param template :模板内容
 * @param variables :变量
 * @return {@link WordprocessingMLPackage} 对象
 * @throws Exception :异常对象
 */
@Override
public WordprocessingMLPackage process(InputStream template, Map<String, Object> variables) throws Exception {
	// Document loading (required)
	WordprocessingMLPackage wordMLPackage;
	if (template == null) {
		// Create a docx
		System.out.println("No imput path passed, creating dummy document");
		wordMLPackage = WordprocessingMLPackage.createPackage();
		SampleDocument.createContent(wordMLPackage.getMainDocumentPart());	
	} else {
		System.out.println("Loading file from InputStream");
		wordMLPackage = Docx4J.load(template);
	}
       if (null != variables && !variables.isEmpty()) {
       	// 替换变量并输出Word文档 
       	MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();
       	// 将${}里的内容结构层次替换为一层
       	VariablePrepare.prepare(wordMLPackage);
       	WMLPackageUtils.cleanDocumentPart(documentPart);
       	// 替换变量
       	documentPart.pipe( new VariableReplaceSaTXHandler( this.getPlaceholderStart() , this.getPlaceholderEnd(), variables) );
        }
       // 返回WordprocessingMLPackage对象
	return FontMapperHolder.useFontMapper(wordMLPackage);
}
 
Example 6
Source File: WmlElementUtils.java    From docx4j-template with Apache License 2.0 6 votes vote down vote up
/**
 * @Description:得到所有表格
 */
public static List<Tbl> getAllTbl(WordprocessingMLPackage wordMLPackage) {
    MainDocumentPart mainDocPart = wordMLPackage.getMainDocumentPart();
    List<Object> objList = getAllElementFromObject(mainDocPart, Tbl.class);
    if (objList == null) {
        return null;
    }
    List<Tbl> tblList = new ArrayList<Tbl>();
    for (Object obj : objList) {
        if (obj instanceof Tbl) {
            Tbl tbl = (Tbl) obj;
            tblList.add(tbl);
        }
    }
    return tblList;
}
 
Example 7
Source File: Docx4J_简单例子.java    From docx4j-template with Apache License 2.0 5 votes vote down vote up
public void addPageBreak(WordprocessingMLPackage wordMLPackage,
		ObjectFactory factory) {
	MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();
	Br breakObj = new Br();
	breakObj.setType(STBrType.PAGE);
	P paragraph = factory.createP();
	paragraph.getContent().add(breakObj);
	documentPart.addObject(paragraph);
}
 
Example 8
Source File: Docx4j_创建批注_S3_Test.java    From docx4j-template with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {  
    Docx4j_创建批注_S3_Test t = new Docx4j_创建批注_S3_Test();  
    WordprocessingMLPackage wordMLPackage = t  
            .createWordprocessingMLPackage();  
    MainDocumentPart mp = wordMLPackage.getMainDocumentPart();  
    ObjectFactory factory = Context.getWmlObjectFactory();  
    t.testCreateComment(wordMLPackage, mp, factory);  
    t.saveWordPackage(wordMLPackage, new File("f:/saveFile/temp/sys_"  
            + System.currentTimeMillis() + ".docx"));  
}
 
Example 9
Source File: HtmlContentInliner.java    From yarg with Apache License 2.0 5 votes vote down vote up
public void inlineToDocx(WordprocessingMLPackage wordPackage, Text text, Object paramValue, Matcher matcher) {
    try {
        R run = (R) text.getParent();
        wordPackage.getContentTypeManager().addDefaultContentType("xhtml", "text/xhtml");
        MainDocumentPart mainDocumentPart = wordPackage.getMainDocumentPart();
        mainDocumentPart.addAltChunk(AltChunkType.Xhtml, paramValue.toString().getBytes(), run);
        text.setValue("");
    } catch (Exception e) {
        throw new ReportFormattingException("An error occurred while inserting html to docx file", e);
    }
}
 
Example 10
Source File: AddingTableOfContent.java    From docx4j-template with Apache License 2.0 5 votes vote down vote up
/**
 *  首先我们创建对象工厂和包并从包中抽出文档部件. 然后我们添加目录表, 后面跟着一些带有分类
 *  标题样式的段落. 最后我们保存包.
 */
public static void main(String[] args) throws Docx4JException {
    factory = Context.getWmlObjectFactory();
    WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage();
    MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();
 
    addTableOfContent(documentPart);
 
    documentPart.addStyledParagraphOfText("Heading1", "Hello 1");
    documentPart.addStyledParagraphOfText("Heading2", "Hello 2");
    documentPart.addStyledParagraphOfText("Heading3", "Hello 3");
    documentPart.addStyledParagraphOfText("Heading1", "Hello 1");
 
    wordMLPackage.save(new File("src/main/files/HelloWord10.docx"));
}
 
Example 11
Source File: WmlElementUtils.java    From docx4j-template with Apache License 2.0 5 votes vote down vote up
/**
 * @Description: 设置页面背景色
 */
public static void setDocumentBackGround(WordprocessingMLPackage wordPackage, ObjectFactory factory, String color)
        throws Exception {
    MainDocumentPart mdp = wordPackage.getMainDocumentPart();
    CTBackground bkground = mdp.getContents().getBackground();
    if (StringUtils.isNotBlank(color)) {
        if (bkground == null) {
            bkground = factory.createCTBackground();
            bkground.setColor(color);
        }
        mdp.getContents().setBackground(bkground);
    }
}
 
Example 12
Source File: WordToTextRenditionProvider.java    From spring-content with Apache License 2.0 5 votes vote down vote up
@Override
public InputStream convert(InputStream fromInputSource, String toMimeType) {
	try {
		WordprocessingMLPackage pkg = WordprocessingMLPackage.load(fromInputSource);

		MainDocumentPart documentPart = pkg.getMainDocumentPart();

		org.docx4j.wml.Document wmlDocumentEl = (org.docx4j.wml.Document) documentPart
				.getJaxbElement();

		OutputStream os = new FileOutputStream("/tmp/temp.txt");
		Writer out = new OutputStreamWriter(os);

		TextUtils.extractText(wmlDocumentEl, out);
		out.close();

		if (pkg.getMainDocumentPart().getFontTablePart() != null) {
			pkg.getMainDocumentPart().getFontTablePart()
					.deleteEmbeddedFontTempFiles();
		}
		// This would also do it, via finalize() methods
		pkg = null;

		return new FileInputStream("/tmp/temp.txt");

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

	return null;
}
 
Example 13
Source File: MSOUtils.java    From document-management-system with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Fill DOCX template
 */
public static void fillTemplate(InputStream input, HashMap<String, String> model, OutputStream output) throws FileNotFoundException,
		Docx4JException, JAXBException, IOException {
	log.info("fillTemplate({}, {}, {})", new Object[]{input, model, output});
	WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(input);
	MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();

	// Do replace...
	documentPart.variableReplace(model);

	// Save it
	wordMLPackage.save(output);
	log.info("fillTemplate: void");
}
 
Example 14
Source File: MSOUtils.java    From document-management-system with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Replace text
 *
 * See also http://www.docx4java.org/forums/docx-java-f6/best-approach-to-search-replace-in-a-template-merge-t1040.html
 */
public static void replaceText(InputStream input, HashMap<String, String> model, OutputStream output) throws Docx4JException,
		JAXBException, IOException {
	log.info("replaceText({}, {}, {})", new Object[]{input, model, output});
	WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(input);
	MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();

	for (final Map.Entry<String, String> entry : model.entrySet()) {
		new TraversalUtil(documentPart, new TraversalUtil.CallbackImpl() {
			@Override
			public List<Object> apply(Object child) {
				if (child instanceof org.docx4j.wml.Text) {
					org.docx4j.wml.Text t = (org.docx4j.wml.Text) child;

					if (t.getValue().contains(entry.getKey())) {
						t.setValue(t.getValue().replaceAll(entry.getKey(), entry.getValue()));
					}
				}

				return null;
			}
		});
	}

	// Save it
	wordMLPackage.save(output);
	log.info("replaceText: void");
}
 
Example 15
Source File: WordprocessingMLTemplateWriter.java    From docx4j-template with Apache License 2.0 4 votes vote down vote up
public String writeToString(WordprocessingMLPackage wmlPackage) throws IOException, Docx4JException {
	MainDocumentPart document = wmlPackage.getMainDocumentPart();		
	return XmlUtils.marshaltoString(wmlPackage);
}
 
Example 16
Source File: FOPAreaTreeHelper.java    From docx4j-export-FO with Apache License 2.0 4 votes vote down vote up
/**
   * Since we start with headers/footers which each take up approx half the page,
   * there is little room for the body content (which would result in many pages,
   * and unnecessary processing).
   * 
   * At the same time, we need enough body content to produce first page, odd page,
   * and even page for each section.
   * 
   * So this method replaces the existing body content with content which is sufficient
   * for our needs.  This method isn't essential, but it should make things faster.
   * 
   * It leaves the headers/footers untouched, since it is those which we're 
   * most interested in at this point.
   *  
   * @param hfPkg
   */
  static void trimContent(WordprocessingMLPackage hfPkg)   {
  	
  	// Find the sectPrs
  	SectPrFinder sf = new SectPrFinder(hfPkg.getMainDocumentPart());
try {
	new TraversalUtil(hfPkg.getMainDocumentPart().getContents(), sf);
} catch (Docx4JException e) {
	// TODO Auto-generated catch block
	log.error(e.getMessage(), e);
}  

List<SectPr> sectPrList = sf.getSectPrList();

// Was there a body level one?
if (hfPkg.getMainDocumentPart().getJaxbElement().getBody().getSectPr()!=null) {
	//then delete the first entry (which is where SectPrFinder put it)
	sectPrList.remove(0);  
}

// Now generate content; let's use
P filler = createFillerP();
List<Object> contents = hfPkg.getMainDocumentPart().getContent();
contents.clear();

for (SectPr sectPr : sectPrList) {
	
	contents.add(filler);
	contents.add(filler);
	contents.add(filler);
	contents.add(filler);
	
	// We expect to cause, in due course, something like:
	// WARN org.apache.fop.apps.FOUserAgent .processEvent line 97 - 
	//          The contents of fo:region-body on page 6 exceed its viewport 
	//          by 29068 millipoints. (See position 1:1038)


	// now add the sectPr
   	P p = Context.getWmlObjectFactory().createP(); 
  	    PPr ppr = Context.getWmlObjectFactory().createPPr(); 
  	    p.setPPr(ppr);
  	    ppr.setSectPr(sectPr);
  	    
	contents.add(p);
	
}

// Add content before the body level sectPr
if (hfPkg.getMainDocumentPart().getJaxbElement().getBody().getSectPr()!=null) {

	contents.add(filler);
	contents.add(filler);
	contents.add(filler);
	contents.add(filler);
	
}
  }
 
Example 17
Source File: DocxGenerator.java    From blog-tutorials with MIT License 4 votes vote down vote up
public byte[] generateDocxFileFromTemplate(UserInformation userInformation) throws Exception {

        InputStream templateInputStream = this.getClass().getClassLoader().getResourceAsStream(TEMPLATE_NAME);

        WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(templateInputStream);

        MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();

        VariablePrepare.prepare(wordMLPackage);

        HashMap<String, String> variables = new HashMap<>();
        variables.put("firstName", userInformation.getFirstName());
        variables.put("lastName", userInformation.getLastName());
        variables.put("salutation", userInformation.getSalutation());
        variables.put("message", userInformation.getMessage());

        documentPart.variableReplace(variables);

        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();

        wordMLPackage.save(outputStream);

        return outputStream.toByteArray();
    }
 
Example 18
Source File: Docx4j_Helper.java    From docx4j-template with Apache License 2.0 4 votes vote down vote up
public static void name() throws Exception {
  
    WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(new java.io.File(inputfilepath));  
    MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();  
    String titleStr = "测试插入段落";  
    P p = Docx4j_Helper.factory.createP();  
    String rprStr = "<w:rPr xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\"><w:rFonts w:hint=\"eastAsia\" w:ascii=\"Times New Roman\" w:hAnsi=\"Times New Roman\" w:eastAsia=\"宋体\"/><w:b/><w:color w:val=\"333333\"/><w:sz w:val=\"32\"/><w:szCs w:val=\"32\"/></w:rPr>";  
    RPr rpr = (RPr) XmlUtils.unmarshalString(rprStr);  
    setParagraphContent(p, rpr, titleStr);  
    documentPart.getContent().add(5, p);  
      
    String tblPrStr = "<w:tblPr xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\"><w:tblW w:w=\"8522\" w:type=\"dxa\"/><w:tblBorders><w:top w:val=\"single\"  w:sz=\"4\" w:space=\"0\"/><w:left w:val=\"single\"  w:sz=\"4\" w:space=\"0\"/><w:bottom w:val=\"single\"  w:sz=\"4\" w:space=\"0\"/><w:right w:val=\"single\"  w:sz=\"4\" w:space=\"0\"/><w:insideH w:val=\"single\"  w:sz=\"4\" w:space=\"0\"/></w:tblBorders></w:tblPr>";  
    Tbl tbl = Docx4j_Helper.factory.createTbl();  
    TblPr tblPr = (TblPr) XmlUtils.unmarshalString(tblPrStr);  
    tbl.setTblPr(tblPr);  
    Tr tr = Docx4j_Helper.factory.createTr();  
    Tc tc = Docx4j_Helper.factory.createTc();  
    tr.getContent().add(tc);  
      
    tc = Docx4j_Helper.factory.createTc();  
    tr.getContent().add(tc);  
      
    tc = Docx4j_Helper.factory.createTc();  
    tr.getContent().add(tc);  
      
    tc = Docx4j_Helper.factory.createTc();  
    tr.getContent().add(tc);  
      
    tc = Docx4j_Helper.factory.createTc();  
    tr.getContent().add(tc);  
    tbl.getContent().add(tr);  
      
    tr = Docx4j_Helper.factory.createTr();  
    tc = Docx4j_Helper.factory.createTc();  
    tr.getContent().add(tc);  
      
    tc = Docx4j_Helper.factory.createTc();  
    tr.getContent().add(tc);  
      
    tc = Docx4j_Helper.factory.createTc();  
    tr.getContent().add(tc);  
      
    tc = Docx4j_Helper.factory.createTc();  
    tr.getContent().add(tc);  
      
    tc = Docx4j_Helper.factory.createTc();  
    tr.getContent().add(tc);  
    tbl.getContent().add(tr);  
    documentPart.getContent().add(9, tbl);  
      
    //Docx4j_Helper.saveWordPackage(wordMLPackage, outputfilepath);  
}
 
Example 19
Source File: Docx4j_Helper.java    From docx4j-template with Apache License 2.0 4 votes vote down vote up
public void testDocx4jSetPageSize() throws Exception {  
    WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage();  
    MainDocumentPart mdp = wordMLPackage.getMainDocumentPart();  
  
    String titleStr="静夜思    李白";  
    String str="床前明月光,疑似地上霜。";  
    String str2="举头望明月,低头思故乡。";  
    P p = Docx4j_Helper.factory.createP();  
    String rprStr = "<w:rPr xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\"><w:rFonts w:hint=\"eastAsia\" w:ascii=\"Times New Roman\" w:hAnsi=\"Times New Roman\" w:eastAsia=\"宋体\"/><w:b/><w:color w:val=\"333333\"/><w:sz w:val=\"32\"/><w:szCs w:val=\"32\"/></w:rPr>";  
    RPr rpr = (RPr) XmlUtils.unmarshalString(rprStr);  
    setParagraphContent(p, rpr,titleStr);  
    mdp.addObject(p);  
      
    p = Docx4j_Helper.factory.createP();  
    setParagraphContent(p, rpr,str);  
    mdp.addObject(p);  
      
    p = Docx4j_Helper.factory.createP();  
    PPr pPr=Docx4j_Helper.factory.createPPr();  
    //设置文字方向  
    SectPr sectPr = Docx4j_Helper.factory.createSectPr();  
    TextDirection textDirect = Docx4j_Helper.factory.createTextDirection();  
    //文字方向:垂直方向从右往左  
    textDirect.setVal("tbRl");  
    sectPr.setTextDirection(textDirect);  
    Type sectType = Docx4j_Helper.factory.createSectPrType();  
    //下一页  
    sectType.setVal("nextPage");  
    sectPr.setType(sectType);  
    //设置页面大小  
    PgSz pgSz =  Docx4j_Helper.factory.createSectPrPgSz();  
    pgSz.setW(new BigInteger("8335"));  
    pgSz.setH(new BigInteger("11850"));  
    sectPr.setPgSz(pgSz);  
    pPr.setSectPr(sectPr);  
    p.setPPr(pPr);  
    setParagraphContent(p, rpr,str2);  
    mdp.addObject(p);  
      
    p = createParagraphWithHAlign();  
    setParagraphContent(p, rpr,titleStr);  
    mdp.addObject(p);  
      
    p = createParagraphWithHAlign();  
    setParagraphContent(p, rpr,str);  
    mdp.addObject(p);  
      
    p = createParagraphWithHAlign();  
    setParagraphContent(p, rpr,str2);  
    mdp.addObject(p);  
   // Docx4j_Helper.saveWordPackage(wordMLPackage, outputfilepath);  
}
 
Example 20
Source File: TextBoxTest.java    From docx4j-export-FO with Apache License 2.0 2 votes vote down vote up
private static WordprocessingMLPackage createTextBoxDocx(boolean w10WrapEl, String style) throws InvalidFormatException {
		
		// speedup
//		String regex = ".*(calibri|cour|arial|times|comic|georgia|impact|LSANS|pala|tahoma|trebuc|verdana|symbol|webdings|wingding).*";
		String regex = ".*(calibri|cour|arial).*";
		PhysicalFonts.setRegex(regex);		

		WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage();
		MainDocumentPart mdp = wordMLPackage.getMainDocumentPart();
		
	    P p = new P();
	    mdp.getContent().add(p);
	    
	    R r = Context.getWmlObjectFactory().createR(); 
	    
	    r.getContent().add(
	    		
	    		// Absolute position to the right of column produces:

				// margin-left:108pt
				// mso-position-horizontal:absolute <------------
				// mso-position-horizontal-relative:text
		    	// mso-wrap-style:square

		// style="position:absolute;margin-left:108pt;margin-top:0;width:186.95pt;height:110.55pt;z-index:251659264;visibility:visible;mso-wrap-style:square;mso-width-percent:400;mso-height-percent:200;mso-wrap-distance-left:9pt;mso-wrap-distance-top:0;mso-wrap-distance-right:9pt;mso-wrap-distance-bottom:0;mso-position-horizontal:absolute;mso-position-horizontal-relative:text;mso-position-vertical:absolute;mso-position-vertical-relative:text;mso-width-percent:400;mso-height-percent:200;mso-width-relative:margin;mso-height-relative:margin;v-text-anchor:top" 
	    		createPict(w10WrapEl, style,
	    				createContent("text box content text box content text box content text box content text box content text box content text box content text box content text box content text box content text box content text box content text box content text box content text box content text box content ")));

	    
	    
	    		// Relative position is done in percentages..

				//  mso-left-percent:600
				//  mso-position-horizontal-relative:left-margin-area
				//  mso-width-relative:margin
	    
//	    style="position:absolute;margin-left:0;margin-top:0;width:186.95pt;height:110.55pt;z-index:251659264;visibility:visible;mso-wrap-style:square;mso-width-percent:400;mso-height-percent:200;mso-left-percent:600;mso-wrap-distance-left:9pt;mso-wrap-distance-top:0;mso-wrap-distance-right:9pt;mso-wrap-distance-bottom:0;mso-position-horizontal-relative:left-margin-area;mso-position-vertical:absolute;mso-position-vertical-relative:text;mso-width-percent:400;mso-height-percent:200;mso-left-percent:600;mso-width-relative:margin;mso-height-relative:margin;v-text-anchor:top" 
	    

	    
	    p.getContent().add( r); 
	    
	    p.getContent().add(addFiller());
	    
	    return wordMLPackage;
		
	}