Package org.apache.fop.apps

Examples of org.apache.fop.apps.FormattingResults


            // Start XSLT transformation and FOP processing
            transformer.transform(src, res);

            // Result processing
            FormattingResults foResults = fop.getResults();
            java.util.List pageSequences = foResults.getPageSequences();
            for (java.util.Iterator it = pageSequences.iterator(); it.hasNext();) {
                PageSequenceResults pageSequenceResults = (PageSequenceResults)it.next();
                System.out.println("PageSequence "
                        + (String.valueOf(pageSequenceResults.getID()).length() > 0
                                ? pageSequenceResults.getID() : "<no id>")
                        + " generated " + pageSequenceResults.getPageCount() + " pages.");
            }
            System.out.println("Generated " + foResults.getPageCount() + " pages in total.");

        } catch (Exception e) {
            e.printStackTrace(System.err);
            System.exit(-1);
        } finally {
View Full Code Here


                pdfname = foname.substring(0, p) + ".pdf";
                File pdffile = new File(outDir, pdfname);

                // transform and render
                System.out.print("Transforming " + fofile + " to PDF file " + pdffile + "...");
                FormattingResults foResults = convertFO2PDF(fofile, pdffile);
                System.out.println("done!");

                // Result processing
                java.util.List pageSequences = foResults.getPageSequences();
                for (java.util.Iterator it = pageSequences.iterator(); it.hasNext();) {
                    PageSequenceResults pageSequenceResults = (PageSequenceResults)it.next();
                    System.out.println("PageSequence "
                            + (String.valueOf(pageSequenceResults.getID()).length() > 0
                                    ? pageSequenceResults.getID() : "<no id>")
                            + " generated " + pageSequenceResults.getPageCount() + " pages.");
                }
                System.out.println("Generated " + foResults.getPageCount() + " pages in total.");

            } catch (Exception e) {
                System.out.println("failure!");
                e.printStackTrace(System.out);
            } finally {
View Full Code Here

           
            // Start XSLT transformation and FOP processing
            transformer.transform(src, res);
           
            // Result processing
            FormattingResults foResults = fop.getResults();
            java.util.List pageSequences = foResults.getPageSequences();
            for (java.util.Iterator it = pageSequences.iterator(); it.hasNext();) {
                PageSequenceResults pageSequenceResults = (PageSequenceResults)it.next();
                System.out.println("PageSequence "
                        + (String.valueOf(pageSequenceResults.getID()).length() > 0
                                ? pageSequenceResults.getID() : "<no id>")
                        + " generated " + pageSequenceResults.getPageCount() + " pages.");
            }
            System.out.println("Generated " + foResults.getPageCount() + " pages in total.");

        } catch (Exception e) {
            e.printStackTrace(System.err);
            System.exit(-1);
        } finally {
View Full Code Here

                pdfname = foname.substring(0, p) + ".pdf";
                File pdffile = new File(outDir, pdfname);

                // transform and render
                System.out.print("Transforming " + fofile + " to PDF file " + pdffile + "...");
                FormattingResults foResults = convertFO2PDF(fofile, pdffile);
                System.out.println("done!");

                // Result processing
                java.util.List pageSequences = foResults.getPageSequences();
                for (java.util.Iterator it = pageSequences.iterator(); it.hasNext();) {
                    PageSequenceResults pageSequenceResults = (PageSequenceResults)it.next();
                    System.out.println("PageSequence "
                            + (String.valueOf(pageSequenceResults.getID()).length() > 0
                                    ? pageSequenceResults.getID() : "<no id>")
                            + " generated " + pageSequenceResults.getPageCount() + " pages.");
                }
                System.out.println("Generated " + foResults.getPageCount() + " pages in total.");

            } catch (Exception e) {
                System.out.println("failure!");
                e.printStackTrace(System.out);
            } finally {
View Full Code Here

   
    /* (non-Javadoc)
     * @see LayoutEngineCheck#check(LayoutResult)
     */
    public void check(LayoutResult result) {
        FormattingResults results = result.getResults();
        String actual;
        if (property.equals("pagecount")) {
            actual = Integer.toString(results.getPageCount());
        } else {
            throw new RuntimeException("No such property test: " + property);
        }
        if (!expected.equals(actual)) {
            throw new RuntimeException(
View Full Code Here

       
        Document doc = (Document)domres.getNode();
        if (this.areaTreeBackupDir != null) {
            saveAreaTreeXML(doc, new File(this.areaTreeBackupDir, testFile.getName() + ".at.xml"));
        }
        FormattingResults results = fop.getResults();       
        LayoutResult result = new LayoutResult(doc, elCollector, results);
        checkAll(testFile, result);
    }
View Full Code Here

    /* (non-Javadoc)
     * @see LayoutEngineCheck#check(LayoutResult)
     */
    public void check(LayoutResult result) {
        FormattingResults results = result.getResults();
        String actual;
        if (property.equals("pagecount")) {
            actual = Integer.toString(results.getPageCount());
        } else {
            throw new RuntimeException("No such property test: " + property);
        }
        if (!expected.equals(actual)) {
            throw new RuntimeException(
View Full Code Here

        Document doc = (Document)domres.getNode();
        if (this.areaTreeBackupDir != null) {
            env.saveDOM(doc,
                    new File(this.areaTreeBackupDir, testFile.getName() + ".at.xml"));
        }
        FormattingResults results = fop.getResults();
        LayoutResult result = new LayoutResult(doc, elCollector, results);
        checkAll(testFile, result);
    }
View Full Code Here

           
            // Start XSLT transformation and FOP processing
            transformer.transform(src, res);
           
            // Result processing
            FormattingResults foResults = fop.getResults();
            java.util.List pageSequences = foResults.getPageSequences();
            for (java.util.Iterator it = pageSequences.iterator(); it.hasNext();) {
                PageSequenceResults pageSequenceResults = (PageSequenceResults)it.next();
                System.out.println("PageSequence "
                        + (String.valueOf(pageSequenceResults.getID()).length() > 0
                                ? pageSequenceResults.getID() : "<no id>")
                        + " generated " + pageSequenceResults.getPageCount() + " pages.");
            }
            System.out.println("Generated " + foResults.getPageCount() + " pages in total.");

        } catch (Exception e) {
            e.printStackTrace(System.err);
            System.exit(-1);
        } finally {
View Full Code Here

        this.property = node.getAttributes().getNamedItem("property").getNodeValue();
    }

    /** {@inheritDoc} */
    public void check(LayoutResult result) {
        FormattingResults results = result.getResults();
        String actual;
        if (property.equals("pagecount")) {
            actual = Integer.toString(results.getPageCount());
        } else {
            throw new RuntimeException("No such property test: " + property);
        }
        if (!expected.equals(actual)) {
            throw new RuntimeException(
View Full Code Here

TOP

Related Classes of org.apache.fop.apps.FormattingResults

Copyright © 2018 www.massapicom. 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.