Package net.sf.jpluck.plucker.functions

Examples of net.sf.jpluck.plucker.functions.EmbeddedImage


    private Functions() {
        // Private constructor to prevent instantiation and subclassing.
    }

    public static EmbeddedImage embeddedImage(String uri) {
        return new EmbeddedImage(uri);
    }
View Full Code Here


      Object obj = iterator.next();
      if (obj instanceof Text) {
        size += ((Text) obj).getSize();
      }
      if (obj instanceof EmbeddedImage) {
        EmbeddedImage image = (EmbeddedImage) obj;
        if ((textRecord.document.resolve(image.getURI()) == null) && (image.getAlt() != null)) {
          // Alt text if image is not found
          size += (2 + image.getAlt().getSize());
          continue;
        }
      }
      if (obj instanceof Function) {
        size += (1 + ((Function) obj).getSize()); // preceding NUL + size of the function itself
View Full Code Here

      anchorList.add(anchor);
    }
  }

  public Paragraph addEmbeddedImage(String uri) {
    return addFunction(new EmbeddedImage(uri));
  }
View Full Code Here

    return addFunction(new EmbeddedImage(uri));
  }

  public Paragraph addEmbeddedImage(String uri, String alt) {
    if (alt != null) {
      return addFunction(new EmbeddedImage(uri, new Text(alt, textRecord.getOutputEncoding())));
    } else {
      return addFunction(new EmbeddedImage(uri));
    }
  }
View Full Code Here

          text.write(out);
        }
      } else if (obj instanceof Function) {
        Function function = (Function) obj;
        if (function instanceof EmbeddedImage) {
          EmbeddedImage image = (EmbeddedImage) function;
          if (textRecord.document.getLinkableRecord(image.getURI()) == null) {
            // If the image is not found in the Document then we try to write the alt text instead.
            if ((image.getAlt() != null) && (image.getAlt().getSize() > 0) &&
                textRecord.document.isIncludeImageAltText()) {
              out.writeString("[");
              image.getAlt().write(out);
              out.writeString("]");
            }
            continue;
          }
        }
View Full Code Here

TOP

Related Classes of net.sf.jpluck.plucker.functions.EmbeddedImage

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.