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"));
      }
      int contentSize = content.size();
        setMcDepth(getMcDepth() - 1);
        content.append("EMC").append_i(separator);
        markedContentSize += content.size() - contentSize;
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 (isTagged()) {
                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

  public void setParams(RichMediaParams params) {
    if (flash) {
      put(PdfName.PARAMS, params);
    }
    else {
      throw new IllegalPdfSyntaxException("Parameters can only be set for Flash instances.");
    }
  }
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

   * (Part of the RichMediaContent.)
   * @param  configuration  a configuration dictionary
   */
  public PdfIndirectReference addConfiguration(RichMediaConfiguration configuration) throws IOException {
    if (configurations == null)
      throw new IllegalPdfSyntaxException(
        "You can't add configurations to reused RichMediaContent.");
    PdfIndirectReference ref = writer.addToBody(configuration).getIndirectReference();
    configurations.add(ref);
    return ref;
  }
View Full Code Here

   * (Part of the RichMediaContent.)
   * @param  ref    a reference to a RichMediaConfiguration
   */
  public PdfIndirectReference addConfiguration(PdfIndirectReference ref) throws IOException {
    if (configurations == null)
      throw new IllegalPdfSyntaxException(
        "You can't add configurations to reused RichMediaContent.");
    configurations.add(ref);
    return ref;
  }
View Full Code Here

   * (Part of the RichMediaContent.)
   * @param  view  a view dictionary
   */
  public PdfIndirectReference addView(PdfDictionary view) throws IOException {
    if (views == null)
      throw new IllegalPdfSyntaxException(
        "You can't add views to reused RichMediaContent.");
    PdfIndirectReference ref = writer.addToBody(view).getIndirectReference();
    views.add(ref);
    return ref;
  }
View Full Code Here

   * (Part of the RichMediaContent.)
   * @param  ref  a reference to a view dictionary
   */
  public PdfIndirectReference addView(PdfIndirectReference ref) throws IOException {
    if (views == null)
      throw new IllegalPdfSyntaxException(
        "You can't add views to reused RichMediaContent.");
    views.add(ref);
    return ref;
  }
View Full Code Here

   */
  public void setAction(PdfObject action) {
    if (action instanceof PdfDictionary || action instanceof PdfIndirectReference)
      put(PdfName.A, action);
    else
      throw new IllegalPdfSyntaxException(
        "An action should be defined as a dictionary");
  }
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.