示例#1
0
  public void latex2pdf_allData() {
    String filename1 = "AllResultsIndep-" + Utils.getCurrentData();

    File Directory = new File(System.getProperty("user.dir").replace("\\", "/") + "/latexTemplate");
    File template1 = new File(Directory.getAbsolutePath() + File.separator + "indepDataSet.tex");
    File texfile1 = new File(Directory.getAbsolutePath() + File.separator + filename1 + ".tex");

    try {

      HashMap<String, String> data = new HashMap<String, String>();
      data.put("indepDataSet", this.Latex);
      JLRConverter converter = new JLRConverter("::", ":::");
      if (!converter.parse(template1, texfile1, data)) {
        System.out.println(converter.getErrorMessage());
      }
      JLRGenerator pdfGen = new JLRGenerator();
      pdfGen.deleteTempTexFile(true);
      if (!pdfGen.generate(texfile1, Directory, Directory)) {
        System.out.println(pdfGen.getErrorMessage());
      }
      copyFile(Directory + File.separator + filename1 + ".pdf", this.savePath + filename1 + ".pdf");
      new File(Directory + File.separator + filename1 + ".pdf").delete();
      new File(Directory + File.separator + filename1 + ".spl").delete();

    } catch (IOException ex) {
      System.err.println(ex.getMessage());
    }
  }
示例#2
0
 /** @param args */
 public static void main(String[] args) {
   // TODO Auto-generated method stub
   String p = "C:/Users/Eric/Desktop/2012春/java-report/JLR/";
   String[] r = {"xx", "bb"};
   String[] c = {"xxx", "bbx", "xxaaa"};
   String t = "fefefef";
   Vector<String[]> d = new Vector<String[]>();
   String[] a1 = {"1", "2", "3"};
   String[] a2 = {"1a", "2a", "3a"};
   d.add(a1);
   d.add(a2);
   String n = "afeefe";
   // showTable tt = new showTable(p,r,c,d,t,n);
   System.out.println(Utils.getCurrentData());
 }