Package org.docx4j.wml

Examples of org.docx4j.wml.CTCompat


   * @return
   * @throws Docx4JException
   */
  public CTCompatSetting getWordCompatSetting(String name) throws Docx4JException {
 
    CTCompat compat = this.getContents().getCompat();
    if (compat==null) {
      log.warn("No w:settings/w:compat element");
      return null;
    }
    /* w:name="overrideTableStyleFontSizeAndJustification"
     * w:uri="http://schemas.microsoft.com/office/word"
     * w:val="1"
     */
    CTCompatSetting theSetting = null;
    for (CTCompatSetting setting : compat.getCompatSetting() ) {
      if (setting.getUri().equals("http://schemas.microsoft.com/office/word")
          && setting.getName().equals(name)) {
        theSetting = setting;
        break;
      }
View Full Code Here


    return theSetting;
  }

  public void setWordCompatSetting(String name, String val) throws Docx4JException {
   
    CTCompat compat = this.getContents().getCompat();
    if (compat==null) {
      log.debug("No w:settings/w:compat element; creating..");
    }
    compat = Context.getWmlObjectFactory().createCTCompat();
    this.getContents().setCompat(compat);
   
    CTCompatSetting theSetting = null;
    for (CTCompatSetting setting : compat.getCompatSetting() ) {
      if (setting.getUri().equals("http://schemas.microsoft.com/office/word")
          && setting.getName().equals(name)) {
        theSetting = setting;
        break;
      }
    }
   
    if (theSetting==null) {
      theSetting = Context.getWmlObjectFactory().createCTCompatSetting();
      theSetting.setUri("http://schemas.microsoft.com/office/word");
      theSetting.setName(name);
      compat.getCompatSetting().add(theSetting);
    }
    theSetting.setVal(val);
  }
View Full Code Here

        // Create object for characterSpacingControl
        CTCharacterSpacing characterspacing = wmlObjectFactory.createCTCharacterSpacing();
        settings.setCharacterSpacingControl(characterspacing);
            characterspacing.setVal(org.docx4j.wml.STCharacterSpacing.COMPRESS_PUNCTUATION);
        // Create object for compat
        CTCompat compat = wmlObjectFactory.createCTCompat();
        settings.setCompat(compat);
            // Create object for balanceSingleByteDoubleByteWidth
            BooleanDefaultTrue booleandefaulttrue = wmlObjectFactory.createBooleanDefaultTrue();
            compat.setBalanceSingleByteDoubleByteWidth(booleandefaulttrue);
           
        // <w:themeFontLang w:val="en-US" w:eastAsia="zh-CN"/>
        // Create object for themeFontLang
        CTLanguage language = wmlObjectFactory.createCTLanguage();
        settings.setThemeFontLang(language);
View Full Code Here

TOP

Related Classes of org.docx4j.wml.CTCompat

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.