Package org.docx4j.openpackaging.parts.WordprocessingML

Examples of org.docx4j.openpackaging.parts.WordprocessingML.FontTablePart


    //String inputfilepath = "/home/jharrop/workspace200711/docx4j-001/sample-docs/fonts-modesOfApplication.docx";
    //String inputfilepath = "/home/jharrop/workspace200711/docx4all/sample-docs/TargetFeatureSet.docx"; //docx4all-fonts.docx";
   
    WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(new java.io.File(inputfilepath));
       
    FontTablePart fontTablePart= wordMLPackage.getMainDocumentPart().getFontTablePart();   
    org.docx4j.wml.Fonts fonts = (org.docx4j.wml.Fonts)fontTablePart.getJaxbElement();   
 
    BestMatchingMapper s = new BestMatchingMapper();
       
    ///////////////
    // Go through the FontsTable, and see what we have filenames for.
View Full Code Here


    if ( fm.getClass().getName().equals("org.docx4j.fonts.BestMatchingMapper") ) {
     
     
      // 2.  For each font, find the closest match on the system (use OO's VCL.xcu to do this)
      //     - do this in a general way, since docx4all needs this as well to display fonts   
      FontTablePart fontTablePart= this.getMainDocumentPart().getFontTablePart()
     
      if (fontTablePart==null) {
        log.warn("FontTable missing; creating default part.");
        fontTablePart= new org.docx4j.openpackaging.parts.WordprocessingML.FontTablePart();
        fontTablePart.unmarshalDefaultFonts();
        fontTablePart.processEmbeddings();
      }
     
      fonts = (org.docx4j.wml.Fonts)fontTablePart.getJaxbElement();
    }
   
    if (populate) {
      fontMapper.populateFontMappings(fontsInUse, fonts);
    }
View Full Code Here

    //String inputfilepath = "/home/jharrop/workspace200711/docx4all/sample-docs/TargetFeatureSet.docx"; //docx4all-fonts.docx";
    String inputfilepath = "C:\\Documents and Settings\\Jason Harrop\\My Documents\\Downloads\\AUMS-easy.docx";
   
    WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(new java.io.File(inputfilepath));
       
    FontTablePart fontTablePart= wordMLPackage.getMainDocumentPart().getFontTablePart();   
    org.docx4j.wml.Fonts fonts = (org.docx4j.wml.Fonts)fontTablePart.getJaxbElement();   
 
    IdentityPlusMapper s = new IdentityPlusMapper();
       
    ///////////////
    // Go through the FontsTable, and see what we have filenames for.
View Full Code Here

    return new WebSettingsPart(new PartName(partName));
  }

  public Part CreateFontTablePartObject(String partName)
      throws InvalidFormatException {
    return new FontTablePart(new PartName(partName));
  }
View Full Code Here

       
      } catch (InvalidFormatException e) {}
     
      // Fonts
      try {
        FontTablePart fontsPart = new FontTablePart();
        fontsPart.setJaxbElement(transitionContainer.getFonts());
               
        mdp.addTargetPart(fontsPart);
      } catch (InvalidFormatException e) {}
    }
   
View Full Code Here

TOP

Related Classes of org.docx4j.openpackaging.parts.WordprocessingML.FontTablePart

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.