Changeset 1248


Ignore:
Timestamp:
09/29/10 03:14:40 (20 months ago)
Author:
jharrop
Message:

Make this work from the command line

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/docx4j/src/main/java/org/docx4j/samples/DisplayMainDocumentPartXml.java

    r520 r1248  
    2222 
    2323 
    24 import java.util.List; 
    25  
    26 import javax.xml.bind.JAXBElement; 
    27  
    28 import org.docx4j.openpackaging.io.LoadFromZipFile; 
    29 import org.docx4j.openpackaging.io.SaveToZipFile; 
    3024import org.docx4j.openpackaging.packages.WordprocessingMLPackage; 
    3125import org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart; 
    32 import org.docx4j.wml.Body; 
    3326 
    3427 
    35 public class DisplayMainDocumentPartXml { 
     28public class DisplayMainDocumentPartXml extends AbstractSample { 
    3629 
    3730 
     
    4134                public static void main(String[] args) throws Exception { 
    4235 
    43                         //String inputfilepath = "/home/jharrop/tmp/simple.docx"; 
    44                         String inputfilepath = System.getProperty("user.dir") + "/sample-docs/TableAndPng.docx"; 
     36                        /* 
     37                         * You can invoke this from an OS command line with something like: 
     38                         *  
     39                         * java -cp dist/docx4j.jar:dist/log4j-1.2.15.jar 
     40                         * org.docx4j.samples.DisplayMainDocumentPartXml inputdocx 
     41                         *  
     42                         * Note the minimal set of supporting jars. 
     43                         *  
     44                         * If there are any images in the document, you will also need: 
     45                         *  
     46                         * dist/xmlgraphics-commons-1.4.jar:dist/commons-logging-1.1.1.jar 
     47                         */ 
     48 
     49                        try { 
     50                                getInputFilePath(args); 
     51                        } catch (IllegalArgumentException e) { 
     52                                inputfilepath = System.getProperty("user.dir") 
     53                                                + "/sample-docs/sample-docx.xml"; 
     54 
     55//                              inputfilepath = System.getProperty("user.dir") 
     56//                              + "/tmp/toc.docx"; 
     57                        } 
    4558                         
    4659                        // Open a document from the file system 
Note: See TracChangeset for help on using the changeset viewer.