Package org.apache.fop.apps

Examples of org.apache.fop.apps.FOPException


    /**
     * checks whether all necessary information has been given in a consistent way
     */
    private void checkSettings() throws FOPException, FileNotFoundException {
        if (inputmode == NOT_SET) {
            throw new FOPException("No input file specified");
        }

        if (outputmode == NOT_SET) {
            throw new FOPException("No output file specified");
        }

        if (inputmode == XSLT_INPUT) {
            // check whether xml *and* xslt file have been set
            if (xmlfile == null) {
                throw new FOPException("XML file must be specified for the tranform mode");
            }
            if (xsltfile == null) {
                throw new FOPException("XSLT file must be specified for the tranform mode");
            }

            // warning if fofile has been set in xslt mode
            if (fofile != null) {
                MessageHandler.errorln("WARNING: Can't use fo file with transform mode! Ignoring.\n"
View Full Code Here


     * returns the chosen renderer, throws FOPException
     */
    public int getRenderer() throws FOPException {
        switch (outputmode) {
        case NOT_SET:
            throw new FOPException("Renderer has not been set!");
        case PDF_OUTPUT:
            return Driver.RENDER_PDF;
        case AWT_OUTPUT:
            return Driver.RENDER_AWT;
        case MIF_OUTPUT:
            return Driver.RENDER_MIF;
        case PRINT_OUTPUT:
            return Driver.RENDER_PRINT;
        case PCL_OUTPUT:
            return Driver.RENDER_PCL;
        case PS_OUTPUT:
            return Driver.RENDER_PS;
        case TXT_OUTPUT:
            return Driver.RENDER_TXT;
        case AREA_OUTPUT:
            rendererOptions.put("fineDetail", isCoarseAreaXml());
            return Driver.RENDER_XML;
        default:
            throw new FOPException("Invalid Renderer setting!");
        }
    }
View Full Code Here

                }));
            } catch (Exception e) {
                if (e instanceof FOPException) {
                    throw (FOPException)e;
                }
                throw new FOPException("AWTStarter could not be loaded.", e);
            }
        case PRINT_OUTPUT:
            try {
                return ((Starter)Class.forName("org.apache.fop.apps.PrintStarter").getConstructor(new Class[] {
                    CommandLineOptions.class
                }).newInstance(new Object[] {
                    this
                }));
            } catch (Exception e) {
                if (e instanceof FOPException) {
                    throw (FOPException)e;
                }
                throw new FOPException("PrintStarter could not be loaded.",
                                       e);
            }

        default:
            return new CommandLineStarter(this);
View Full Code Here

            String s = "any" + key.substring(i);
            f = (String)this.triplets.get(s);
            if (f == null) {
                f = (String)this.triplets.get("any,normal,normal");
                if (f == null) {
                    throw new FOPException("no default font defined by OutputConverter");
                }
                MessageHandler.errorln("WARNING: defaulted font to any,normal,normal");
            }
            MessageHandler.errorln("WARNING: unknown font " + key
                                   + " so defaulted font to any");
View Full Code Here

            return addSpanArea(1);
        } else if (span == Span.NONE) {
            // create new span area with multiple columns; return first column area
            return addSpanArea(columnCount);
        } else {
            throw new FOPException("BodyAreaContainer::getNextArea(): Span attribute messed up");
        }
    }
View Full Code Here

                || areaClass.equals(XSL_FOOTNOTE)
                || areaClass.equals(XSL_SIDE_FLOAT)
                || areaClass.equals(XSL_BEFORE_FLOAT))
            return areaClass;
        else
            throw new FOPException("Unknown area class '" + areaClass + "'");
    }
View Full Code Here

          return prop;
        }
        else {
    // throw some kind of exception!
    throw new FOPException("Can't convert value to Length type");
        }
    }
View Full Code Here

          return prop;
        }
        else {
    // throw some kind of exception!
    throw new FOPException("Can't convert value to Length type");
        }
    }
View Full Code Here

     */
    public Status layout(Area area) throws FOPException {

        if (!(area instanceof ForeignObjectArea)) {
            // this is an error
            throw new FOPException("SVG not in fo:instream-foreign-object");
        }

        if (this.marker == BREAK_AFTER) {
            return new Status(Status.OK);
        }
View Full Code Here

            if (e.getException() instanceof FOPException) {
                dumpError(e.getException());
                throw (FOPException) e.getException();
            } else {
                dumpError(e);
                throw new FOPException(e.getMessage());
            }
        }
        catch (IOException e) {
            dumpError(e);
            throw new FOPException(e.getMessage());
        }
    }
View Full Code Here

TOP

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

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.