Examples of PdfDoc


Examples of org.deepak.util.PdfDoc

        pngDirFile.mkdirs();
      }
    }
    System.setProperty("java.awt.headless", "true");
    String plotFile = outputFile;
    PdfDoc doc = new PdfDoc(plotFile);
    Font font = FontFactory.getFont(FontFactory.COURIER, 16, Font.ITALIC, Color.BLUE);

    Map<Integer, String> inMap = new HashMap<Integer, String>();
    inMap.put(new Integer(2), "Time to fill RAM Buffer (ms)");
    inMap.put(new Integer(3), "Average Flush Rate (per second)");
    inMap.put(new Integer(4), "Items Flushed");
    inMap = new TreeMap<Integer, String>(inMap);
    Iterator<Integer> itr = inMap.keySet().iterator();
    int cnt = 2;

    while (itr.hasNext())
    {
      Integer key = itr.next();
      String yTitle = (String) inMap.get(key);
      int indexVal = key.intValue();
      String chartTitle = yTitle + " Vs. Time";
      Phrase phrase = new Phrase(chartTitle.toUpperCase(), font);
      Chapter chapter = new Chapter(new Paragraph(phrase), (cnt - 1));
      BufferedImage image =
          PlotGraphs.createXYTimeImage(zp._fpd,
                                       1,
                                       new int[] { indexVal },
                                       chartTitle,
                                       "Time",
                                       yTitle,
                                       new String[] { seriesDescription },
                                       _dfPlot,
                                       imageWidth,
                                       imageHeight);
      if (createPngs)
      {
        String fileName =
            pngDirPath + File.separator + "ZoieIndexImage_" + (cnt - 1) + ".png";
        OutputStream ost =
            new BufferedOutputStream(new FileOutputStream(new File(fileName), false));
        ChartUtilities.writeBufferedImageAsPNG(ost, image);
        System.out.println("Image " + (cnt - 1) + " : " + fileName);
      }

      doc.addSingleElement(chapter);
      doc.addMultipleNewLine(4);
      doc.addSingleElement(image);
      doc.addNewPage();
      cnt++;

    }
    doc.closeDocument();

    if (createHtml)
    {
      String[] scenarios =
          new String[] { "Time to fill RAM Buffer (ms)",
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.