Package com.itextpdf.text.exceptions

Examples of com.itextpdf.text.exceptions.IllegalPdfSyntaxException


    /**
     * Ends a marked content sequence
     */
    public void endMarkedContentSequence() {
      if (getMcDepth() == 0) {
        throw new IllegalPdfSyntaxException(MessageLocalization.getComposedMessage("unbalanced.begin.end.marked.content.operators"));
      }
      setMcDepth(getMcDepth() - 1);
        content.append("EMC").append_i(separator);
    }
View Full Code Here


     * @since 2.1.6
     * @throws IllegalPdfSyntaxException (a runtime exception)
     */
    public void sanityCheck() {
      if (getMcDepth() != 0) {
        throw new IllegalPdfSyntaxException(MessageLocalization.getComposedMessage("unbalanced.marked.content.operators"));
      }
      if (inText) {
            if (autoControlTextBlocks) {
                endText();
            } else {
        throw new IllegalPdfSyntaxException(MessageLocalization.getComposedMessage("unbalanced.begin.end.text.operators"));
      }
      }
      if (layerDepth != null && !layerDepth.isEmpty()) {
        throw new IllegalPdfSyntaxException(MessageLocalization.getComposedMessage("unbalanced.layer.operators"));
      }
      if (!stateList.isEmpty()) {
        throw new IllegalPdfSyntaxException(MessageLocalization.getComposedMessage("unbalanced.save.restore.state.operators"));
      }
    }
View Full Code Here

    /**
     * Starts the writing of text.
     */
    public void beginText() {
      if (inText) {
        throw new IllegalPdfSyntaxException(MessageLocalization.getComposedMessage("unbalanced.begin.end.text.operators"));
      }
      inText = true;
        state.xTLM = 0;
        state.yTLM = 0;
        content.append("BT").append_i(separator);
View Full Code Here

    /**
     * Ends the writing of text and makes the current font invalid.
     */
    public void endText() {
      if (!inText) {
        throw new IllegalPdfSyntaxException(MessageLocalization.getComposedMessage("unbalanced.begin.end.text.operators"));
      }
      inText = false;
        content.append("ET").append_i(separator);
    }
View Full Code Here

     */
    public void restoreState() {
        content.append("Q").append_i(separator);
        int idx = stateList.size() - 1;
        if (idx < 0)
            throw new IllegalPdfSyntaxException(MessageLocalization.getComposedMessage("unbalanced.save.restore.state.operators"));
        state = stateList.get(idx);
        stateList.remove(idx);
    }
View Full Code Here

        int n = 1;
        if (layerDepth != null && !layerDepth.isEmpty()) {
            n = layerDepth.get(layerDepth.size() - 1).intValue();
            layerDepth.remove(layerDepth.size() - 1);
        } else {
          throw new IllegalPdfSyntaxException(MessageLocalization.getComposedMessage("unbalanced.layer.operators"));
        }
        while (n-- > 0)
            content.append("EMC").append_i(separator);
    }
View Full Code Here

    /**
     * Ends a marked content sequence
     */
    public void endMarkedContentSequence() {
      if (mcDepth == 0) {
        throw new IllegalPdfSyntaxException(MessageLocalization.getComposedMessage("unbalanced.begin.end.marked.content.operators"));
      }
      --mcDepth;
        content.append("EMC").append_i(separator);
    }
View Full Code Here

     * @since 2.1.6
     * @throws IllegalPdfSyntaxException (a runtime exception)
     */
    public void sanityCheck() {
      if (mcDepth != 0) {
        throw new IllegalPdfSyntaxException(MessageLocalization.getComposedMessage("unbalanced.marked.content.operators"));
      }
      if (inText) {
        throw new IllegalPdfSyntaxException(MessageLocalization.getComposedMessage("unbalanced.begin.end.text.operators"));
      }
      if (layerDepth != null && !layerDepth.isEmpty()) {
        throw new IllegalPdfSyntaxException(MessageLocalization.getComposedMessage("unbalanced.layer.operators"));
      }
      if (!stateList.isEmpty()) {
        throw new IllegalPdfSyntaxException(MessageLocalization.getComposedMessage("unbalanced.save.restore.state.operators"));
      }
    }
View Full Code Here

   * @param  fs    a file specification for an embedded file.
   */
  public PdfIndirectReference addAsset(String name, PdfFileSpecification fs)
    throws IOException {
    if (assetsmap == null)
      throw new IllegalPdfSyntaxException(
        "You can't add assets to reused RichMediaContent.");
    PdfIndirectReference ref = writer.addToBody(fs).getIndirectReference();
    assetsmap.put(name, ref);
    return ref;
  }
View Full Code Here

   * (Part of the RichMediaContent.)
   * @param  ref  a reference to a PdfFileSpecification
   */
  public PdfIndirectReference addAsset(String name, PdfIndirectReference ref) throws IOException {
    if (views == null)
      throw new IllegalPdfSyntaxException(
        "You can't add assets to reused RichMediaContent.");
    assetsmap.put(name, ref);
    return ref;
  }
View Full Code Here

TOP

Related Classes of com.itextpdf.text.exceptions.IllegalPdfSyntaxException

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.