Package org.apache.fop.apps

Examples of org.apache.fop.apps.FOPException


        log.debug("Java2DRenderer stopped");
        renderingDone = true;
        numberOfPages = currentPageNumber;
        // TODO set all vars to null for gc
        if (numberOfPages == 0) {
            new FOPException("No page could be rendered");
        }
    }
View Full Code Here


     * @return the requested PageViewport instance
     * @exception FOPException If the page is out of range.
     */
    public PageViewport getPageViewport(int pageNum) throws FOPException {
        if (pageNum < 0 || pageNum >= pageViewportList.size()) {
            throw new FOPException("Requested page number is out of range: " + pageNum
                     + "; only " + pageViewportList.size()
                     + " page(s) available.");
        }
        return (PageViewport) pageViewportList.get(pageNum);
    }
View Full Code Here

               
            Region body = spm.getRegion(FO_REGION_BODY);
            if (!pageSeq.getMainFlow().getFlowName().equals(body.getRegionName())) {
                // this is fine by the XSL Rec (fo:flow's flow-name can be mapped to
                // any region), but we don't support it yet.
                throw new FOPException("Flow '" + pageSeq.getMainFlow().getFlowName()
                    + "' does not map to the region-body in page-master '"
                    + spm.getMasterName() + "'.  FOP presently "
                    + "does not support this.");
            }
            Page page = new Page(spm, index, pageNumberString, isBlank);
View Full Code Here

                                                    boolean isBlankPage)
                                                      throws FOPException {
        if (currentSubSequence == null) {
            currentSubSequence = getNextSubSequence();
            if (currentSubSequence == null) {
                throw new FOPException("no subsequences in page-sequence-master '"
                                       + masterName + "'");
            }
        }
        String pageMasterName = currentSubSequence
            .getNextPageMasterName(isOddPage, isFirstPage, isLastPage, isBlankPage);
        boolean canRecover = true;
        while (pageMasterName == null) {
            SubSequenceSpecifier nextSubSequence = getNextSubSequence();
            if (nextSubSequence == null) {
                if (!canRecover) {
                    throw new FOPException("subsequences exhausted in page-sequence-master '"
                                           + masterName
                                           + "', cannot recover");
                }
                log.warn("subsequences exhausted in page-sequence-master '"
                                 + masterName
                                 + "', using previous subsequence");
                currentSubSequence.reset();
                canRecover = false;
            } else {
                currentSubSequence = nextSubSequence;
            }
            pageMasterName = currentSubSequence
                .getNextPageMasterName(isOddPage, isFirstPage, isLastPage, isBlankPage);
        }
        SimplePageMaster pageMaster = this.layoutMasterSet
            .getSimplePageMaster(pageMasterName);
        if (pageMaster == null) {
            throw new FOPException("No simple-page-master matching '"
                                   + pageMasterName + "' in page-sequence-master '"
                                   + masterName + "'");
        }
        return pageMaster;
    }
View Full Code Here

                            + " for this output format.");
                } else {
                    if (out == null
                            && userAgent.getRendererOverride() == null
                            && rendMaker.needsOutputStream()) {
                        throw new FOPException(
                            "OutputStream has not been set");
                    }
                    //Found a Renderer so we need to construct an AreaTreeHandler.
                    return new AreaTreeHandler(userAgent, outputFormat, out);
                }
View Full Code Here

    if (f == null) {
      f = (String)this.triplets.get("any," + style + "," + weight);
      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 "+family+" so defaulted font to any");
    }
View Full Code Here

        if (rootFObj == null) {
            rootFObj = fobj;
            if (!fobj.getName().equals("fo:root")) {
                throw new SAXException(
                  new FOPException("Root element must" +
                                   " be root, not " + fobj.getName()));
            }
        } else {
            currentFObj.addChild(fobj);
        }
View Full Code Here

        blockArea.setAbsoluteHeight(area.getAbsoluteHeight());
        blockArea.setIDReferences(area.getIDReferences());

  int numChildren = this.children.size();
  if (numChildren != 2) {
      throw new FOPException("list-item must have exactly two children");
  }
  ListItemLabel label = (ListItemLabel) children.elementAt(0);
  ListItemBody body = (ListItemBody) children.elementAt(1);

  label.setDistanceBetweenStarts(this.distanceBetweenStarts);
View Full Code Here

  this.name =  getElementName();

  if (parent.getName().equals("fo:page-sequence")) {
      this.pageSequence = (PageSequence) parent;
  } else {
      throw new FOPException("flow must be child of "
           + "page-sequence, not "
           + parent.getName());
  }
  setFlowName(getProperty("flow-name").getString());

  // according to communication from Paul Grosso (XSL-List,
  // 001228, Number 406), confusion in spec section 6.4.5 about
  // multiplicity of fo:flow in XSL 1.0 is cleared up - one (1)
  // fo:flow per fo:page-sequence only.
  if (!pageSequence.isFlowSet())
    pageSequence.addFlow(this);
  else
    throw new FOPException("Only a single fo:flow permitted"
    + " per fo:page-sequence");
    }
View Full Code Here

     * @param errorStr error string
     * @param strict validate strictly
     * @throws FOPException fop exception
     */
    public static void handleError(Log log, String errorStr, boolean strict) throws FOPException {
        handleException(log, new FOPException(errorStr), strict);
    }
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.