Examples of PdfProcessor


Examples of com.extremelogic.jtextmarker.PdfProcessor

*/
public class SampleMain {

  public static void main(String[] args) {

    PdfProcessor pdf;
    try {
      Map<String, Object> data = new EntityHandlerMap()
      data.put("title", "This is a title");
      data.put("data", "Jan So");

      ArrayList<SampleListEntry> a = new ArrayList<SampleListEntry>();
      SampleListEntry gbe1 = new SampleListEntry("Jan So", "jan.so@java.com", "jTextMarker Author");
      SampleListEntry gbe2 = new SampleListEntry("Albert Eisntein", "albert.einstein@java.com", "Science");
      SampleListEntry gbe3 = new SampleListEntry("Debbie Que", "debbie.que@java.com", "The One");
      SampleListEntry gbe4 = new SampleListEntry("Jill Arroyo", "jill.test@yahoo.com", "Inspiration");
      a.add(gbe1);
      a.add(gbe2);
      ArrayList<SampleListEntry> b = new ArrayList<SampleListEntry>();
      b.add(gbe3);
      b.add(gbe4);

      data.put("list1", a);
      data.put("list2", b);
      String p = "resources/";     
      WaterMark wm = new WaterMark(p+"sample-watermark.png");

      pdf = new PdfProcessor("sample-output.pdf", "sample-template", p, p+"sample-tagmap.xml", data, wm);

      pdf.generatePdf();

      if (pdf.isGenerated()) {
        System.out.println("done..");
      }
    }catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

Examples of eas.math.fundamentalAlgorithms.graphBased.pdfProcessors.PDFProcessor

                for (RepresentableAsGraph r : GraphBasedWindow.this.graphTypes) {
                    if (r.isAcceptableCode(scriptText)) {
                        accepted++;
                        try {
                            r.createInstanceFromCode(scriptText);
                            PDFProcessor pdfProcessor = r.generatePDFcode(GeneralDialog.promptForExternalFile(
                                    "TEMP-DIRECTORY",
                                    GlobalVariables.getPrematureParameters().getStdDirectory(),
                                    false).getAbsolutePath());
                            GlobalVariables.getPrematureParameters().logDebug("I finished creating the graph, now it's the turn of '" + pdfProcessor.getClass().getSimpleName() + "'...");

//                            if (!graphVizButton.getText().contains("PlainDOT") || GraphViz.class.isAssignableFrom(pdfProcessor.getClass())) {
//                                graphVizButton.setEnabled(true);
//                            } else {
//                                graphVizButton.setEnabled(false);
//                            }
                           
                            // Ask for very long graphs.
                            if (pdfProcessor.getSourceString().length() > pdfProcessor.getCodeSizeToBeConsideredLarge() && !GeneralDialog.yesNoAnswer(
                                    "Large pdf processor code (greater than " + pdfProcessor.getCodeSizeToBeConsideredLarge() + " characters)",
                                    "The current script leads to a " + pdfProcessor.getClass().getSimpleName() + " code that has " + pdfProcessor.getSourceString().length() + " characters.\n"
                                    + "It might take " + pdfProcessor.getClass().getSimpleName() + " a long time to draw. Proceed?")) {
                                pdfProcessor = new GraphViz(TEMP_DIR.getAbsolutePath());
                                pdfProcessor.addln("digraph G {User aborted...}");
                            }

                            pdfProcessor.storeAsPDF("graph", GeneralDialog.promptForExternalFile(
                                    "TEMP-DIRECTORY",
                                    GlobalVariables.getPrematureParameters().getStdDirectory(),
                                    false).getAbsolutePath());
                           
                            JComponent addInfo = r.getAdditionalInfo();
                            this.addInfo.removeAll();
                            if (addInfo != null) {
                                this.addInfo.add(addInfo);
                                this.addInfo.setVisible(false);
                                this.addInfo.setVisible(true);
                            }
                           
                            GlobalVariables.getPrematureParameters().logDebug(pdfProcessor.getClass().getSimpleName() + " drawing terminated successfully.");
                            this.graphVizButton.setText("Convert to plain " + pdfProcessor.getClass().getSimpleName());
                            this.graphVizButton.setBackground(this.buttonAutoScript.getBackground());
                            this.exceptionThrown = null;
                        } catch (Exception e) {
                            GlobalVariables.getPrematureParameters().logDebug(e.toString());
                            this.graphVizButton.setText("(Could not evaluate)");
View Full Code Here

Examples of eas.math.fundamentalAlgorithms.graphBased.pdfProcessors.PDFProcessor

        } else if (e.getSource().equals(this.graphVizButton) && this.graphVizButton.isEnabled()) {
            if (this.exceptionThrown == null) {
                for (RepresentableAsGraph r : this.graphTypes) {
                    if (r.isAcceptableCode(scriptText)) {
                        r.createInstanceFromCode(scriptText);
                        PDFProcessor gv = r.generatePDFcode(GeneralDialog.promptForExternalFile(
                                "TEMP-DIRECTORY",
                                GlobalVariables.getPrematureParameters().getStdDirectory(),
                                false).getAbsolutePath());
                       
                        if (gv.getSourceString() != null) {
                            String code = gv.getSourceString();
                            if (code.endsWith("\n")) {
                                code = code.substring(0, code.length()-1);
                            }
                            this.getScriptArea().setText(gv.getCodePrefix() + code);
                            this.manageUndo();
                            break;
                        } else {
                            GeneralDialog.message("PDF processor '" + gv.getClass().getSimpleName() + "' does not offer plain source code.", "GraphViz not available");
                        }
                    }
                }
            } else {
                GeneralDialog dia = new GeneralDialog(
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.