Package org.docx4j.fonts

Examples of org.docx4j.fonts.IdentityPlusMapper


      System.out.println("Loading file from " + inputfilepath);
      wordMLPackage = WordprocessingMLPackage.load(new java.io.File(inputfilepath));
    }
   
    // Set up font mapper (optional)
    Mapper fontMapper = new IdentityPlusMapper();
    wordMLPackage.setFontMapper(fontMapper);
   
    // .. example of mapping font Times New Roman which doesn't have certain Arabic glyphs
    // eg Glyph "ي" (0x64a, afii57450) not available in font "TimesNewRomanPS-ItalicMT".
    // eg Glyph "ج" (0x62c, afii57420) not available in font "TimesNewRomanPS-ItalicMT".
    // to a font which does
    PhysicalFont font
        = PhysicalFonts.get("Arial Unicode MS");
      // make sure this is in your regex (if any)!!!
    if (font!=null) {
      fontMapper.put("Times New Roman", font);
      fontMapper.put("Arial", font);
    }
    fontMapper.put("Libian SC Regular", PhysicalFonts.get("SimSun"));

    // FO exporter setup (required)
    // .. the FOSettings object
      FOSettings foSettings = Docx4J.createFOSettings();
    if (saveFO) {
View Full Code Here


      newerPackage.save(new File(System.getProperty("user.dir") +"/OUT_CompareDocuments.docx"));
    }
   
    if (PDF_SAVE) {
     
      newerPackage.setFontMapper(new IdentityPlusMapper())
     
      boolean saveFO = false;
      String outputfilepath = System.getProperty("user.dir") "/OUT_CompareDocuments.pdf";
     
      // FO exporter setup (required)
View Full Code Here

     
    }

    public Mapper getFontMapper() {
      if (fontMapper==null) {
        fontMapper = new IdentityPlusMapper();
        // This invokes populateFontMappings
        try {
        setFontMapper(fontMapper);
      } catch (Exception e) {
        // TODO Auto-generated catch block
View Full Code Here

TOP

Related Classes of org.docx4j.fonts.IdentityPlusMapper

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.