Changeset 1167


Ignore:
Timestamp:
07/15/10 12:29:34 (19 months ago)
Author:
jharrop
Message:

Remove iText dependency, which was used in PDF conversion via HTML or iText. These are now in docx4j-extras. If you are planning to use these, you'll also want to uncomment the BaseFont? stuff in PhysicalFonts?.

Location:
trunk/docx4j
Files:
12 added
4 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/docx4j/build.xml

    r1142 r1167  
    3131<!--         <pathelement location="${m2Repository}/com/topologi/diffx/0.61/diffx-0.61.jar"/> 
    3232 --> 
     33  
     34<!--    Uncomment for the PDF conversion via HTML or iText, which 
     35                may be found in docx4j-extras. 
     36                 
     37                If you are planning to use that, you'll also want to uncomment 
     38                the BaseFont stuff in PhysicalFonts.     
     39                 
    3340        <pathelement location="${m2Repository}/com/lowagie/itext-unsigned/2.0.8/itext-unsigned-2.0.8.jar"/>      
    34 <!-- 
    35             <pathelement location="${m2Repository}/com/lowagie/itext/2.0.8/itext-2.0.8.jar"/>  
    3641            --> 
    37     <!--Explicit Exclusions from iText:  
    38         <pathelement location="${m2Repository}/bouncycastle/bcmail-jdk14/138/bcmail-jdk14-138.jar"/> 
    39         <pathelement location="${m2Repository}/bouncycastle/bcprov-jdk14/138/bcprov-jdk14-138.jar"/> 
    40         --> 
     42             
    4143        <pathelement location="${m2Repository}/xalan/xalan-patched/2.7.0/xalan-patched-2.7.0.jar"/> 
    4244        <pathelement location="${m2Repository}/pdf-renderer/pdf-renderer/0.2009.0324/pdf-renderer-0.2009.0324.jar"/> 
     
    162164        <javadoc access="public" author="false"  
    163165         destdir="javadoc"  
    164          doctitle="docx4j 2.3.0"  
     166         doctitle="docx4j 2.4.0"  
    165167         nodeprecated="false"  
    166168         nodeprecatedlist="false"  
  • trunk/docx4j/pom.xml

    r1145 r1167  
    232232                --> 
    233233                 
    234                 <!--  We need SVN build, not v1.3.1, 
    235                           in order to run headless. 
    236                           Replace with public copy once there 
    237                           is something newer than v1.3.1 --> 
    238234                <dependency> 
    239235                        <groupId>org.apache.xmlgraphics</groupId> 
    240236                        <artifactId>xmlgraphics-commons</artifactId> 
    241237                        <version>1.3.757686</version> 
     238                        <!-- Not in maven yet as of 2010 07 15 
     239                                <version>1.4</version> 
     240                                --> 
    242241                </dependency> 
    243242 
     
    253252                        <version>3.4.0</version> 
    254253                </dependency> 
    255                  
     254                 
     255<!--    Uncomment for the PDF conversion via HTML or iText, which 
     256                may be found in docx4j-extras. 
     257                 
     258                If you are planning to use that, you'll also want to uncomment 
     259                the BaseFont stuff in PhysicalFonts.     
     260                 
    256261                <dependency> 
    257262                        <groupId>com.lowagie</groupId> 
     
    269274                        </exclusions> 
    270275                </dependency> 
     276        -->      
    271277                <dependency> 
    272278                        <groupId>xalan</groupId> 
  • trunk/docx4j/src/main/java/org/docx4j/fonts/PhysicalFonts.java

    r991 r1167  
    2020import org.docx4j.openpackaging.parts.WordprocessingML.ObfuscatedFontPart; 
    2121 
    22 import com.lowagie.text.pdf.BaseFont; 
     22//import com.lowagie.text.pdf.BaseFont; 
    2323 
    2424/** 
     
    272272                                         
    273273                                        log.debug(".. found"); 
    274                                          
    275                                         // We're only interested if this font supports UTF-8 encoding 
    276                                         // since otherwise iText can't use it (at least on a 
    277                                         // UTF8 encoded XHTML document)  
    278                                         try { 
    279                                             BaseFont bf = BaseFont.createFont(afm, 
    280                                                         BaseFont.IDENTITY_H,  
    281                                                                         BaseFont.NOT_EMBEDDED); 
    282                                                 } catch (java.io.UnsupportedEncodingException uee) { 
    283                                                         log.error(afm + " does not support UTF encoding, so ignoring"); 
    284                                                         continue; 
    285                                                 } catch (Exception e) { 
    286                                                         log.error(e); 
    287                                                         continue; 
    288                                                 } 
     274 
     275// Uncomment if you want to use the iText stuff in docx4j-extras                                         
     276//                                      // We're only interested if this font supports UTF-8 encoding 
     277//                                      // since otherwise iText can't use it (at least on a 
     278//                                      // UTF8 encoded XHTML document)  
     279//                                      try { 
     280//                                          BaseFont bf = BaseFont.createFont(afm, 
     281//                                                      BaseFont.IDENTITY_H,  
     282//                                                                      BaseFont.NOT_EMBEDDED); 
     283//                                              } catch (java.io.UnsupportedEncodingException uee) { 
     284//                                                      log.error(afm + " does not support UTF encoding, so ignoring"); 
     285//                                                      continue; 
     286//                                              } catch (Exception e) { 
     287//                                                      log.error(e); 
     288//                                                      continue; 
     289//                                              } 
    289290                                        pf = new PhysicalFont(triplet.getName(),fontInfo); 
    290291                                         
     
    298299                                        if (f.exists()) {                                
    299300                                                log.debug(".. found"); 
    300                                                 // We're only interested if this font supports UTF-8 encoding 
    301                                                 try { 
    302                                                     BaseFont bf = BaseFont.createFont(pfm, 
    303                                                                 BaseFont.IDENTITY_H,  
    304                                                                                 BaseFont.NOT_EMBEDDED); 
    305                                                         } catch (java.io.UnsupportedEncodingException uee) { 
    306                                                                 log.error(pfm + " does not support UTF encoding, so ignoring"); 
    307                                                                 continue; 
    308                                                         } catch (Exception e) { 
    309                                                                 log.error(e); 
    310                                                                 continue; 
    311                                                         } 
     301 
     302                                                // Uncomment if you want to use the iText stuff in docx4j-extras                                                                                         
     303//                                              // We're only interested if this font supports UTF-8 encoding 
     304//                                              try { 
     305//                                                  BaseFont bf = BaseFont.createFont(pfm, 
     306//                                                              BaseFont.IDENTITY_H,  
     307//                                                                              BaseFont.NOT_EMBEDDED); 
     308//                                                      } catch (java.io.UnsupportedEncodingException uee) { 
     309//                                                              log.error(pfm + " does not support UTF encoding, so ignoring"); 
     310//                                                              continue; 
     311//                                                      } catch (Exception e) { 
     312//                                                              log.error(e); 
     313//                                                              continue; 
     314//                                                      } 
    312315                                                pf = new PhysicalFont(triplet.getName(), fontInfo); 
    313316                                        } else { 
  • trunk/docx4j/src/main/java/org/docx4j/samples/CreatePdf.java

    r1144 r1167  
    5151                boolean save = true; 
    5252                 
    53 //              String inputfilepath = System.getProperty("user.dir") + "/sample-docs/sample-docx.xml"; 
    54 //              String inputfilepath = System.getProperty("user.dir")  
    55 //                      + "/sample-docs/test-docs/header-footer/header_first.xml";               
     53                String inputfilepath = System.getProperty("user.dir") + "/sample-docs/sample-docx.xml"; 
    5654                //String inputfilepath = System.getProperty("user.dir") + "/docs/Docx4j_GettingStarted.xml";             
    57 //              String inputfilepath = System.getProperty("user.dir")  
    58 //              + "/sample-docs/test-docs/endnotes.xml";                 
    59                 String inputfilepath = "C:\\Users\\jharrop\\workspace\\docx4j\\tmp\\TestDocmToPDFConversion.docm"; 
    6055                 
    6156                        WordprocessingMLPackage wordMLPackage; 
     
    9792                        fontMapper.getFontMappings().put("Algerian", font); 
    9893                         
    99                          
    100                         /* Choose which of the three methods you want to use... 
    101                          *  
    102                          * .. viaHTML uses the old docX2HTML.xslt and xhtmlrenderer,  
    103                          *    and supports numbering, images, 
    104                          *    and tables, but is pretty hard to understand 
    105                          *     
    106                          *    It is a trivial change to instead use  
    107                          *    HTMLExporterNG, but that should produce 
    108                          *    the same output as viaXSLFO, so we don't 
    109                          *    do that.  
    110                          *     
    111                          * .. viaXSLFO uses docx2fo.xslt and FOP.  It is 
    112                          *    coming along, with support for 
    113                          *    headers/footers, images and tables 
    114                          *     
    115                          * .. viaItext - for developers who don't like xslt 
    116                          *    at all! Or want to use iText's features.. 
    117                          *    Displays images, but as at 2009 03 19. 
    118                          *    doesn't try to scale them. 
    119                          *     
    120                          * Fonts should work pretty well via any of these 
    121                          * methods! 
    122                          */ 
     94                        // As of docx4j 2.5.0, only viaXSLFO is supported. 
     95                        // The viaIText and viaHTML source code can be found in src/docx4j-extras directory 
     96                         
    12397                        org.docx4j.convert.out.pdf.PdfConversion c  
    12498//                              = new org.docx4j.convert.out.pdf.viaHTML.Conversion(wordMLPackage); 
Note: See TracChangeset for help on using the changeset viewer.