Package com.itextpdf.text.pdf

Examples of com.itextpdf.text.pdf.PdfDictionary


   * @param  d    the default
   * @param  max    the maximum
   * @param  min    the minimum
   */
  private PdfDictionary createDimensionDictionary(float d, float max, float min) {
    PdfDictionary dict = new PdfDictionary();
    dict.put(PdfName.DEFAULT, new PdfNumber(d));
    dict.put(PdfName.MAX_CAMEL_CASE, new PdfNumber(max));
    dict.put(PdfName.MIN_CAMEL_CASE, new PdfNumber(min));
    return dict;
  }
View Full Code Here


   */
  public RichMediaAnnotation(PdfWriter writer, Rectangle rect) {
    this.writer = writer;
    annot = new PdfAnnotation(writer, rect);
        annot.put(PdfName.SUBTYPE, PdfName.RICHMEDIA);
        richMediaContent = new PdfDictionary(PdfName.RICHMEDIACONTENT);
    assetsmap = new HashMap<String, PdfIndirectReference>();
    configurations = new PdfArray();
    views = new PdfArray();
  }
View Full Code Here

   * @return  a PdfAnnotation
   */
  public PdfAnnotation createAnnotation() throws IOException {
    if (richMediaContent != null) {
      if (!assetsmap.isEmpty()) {
        PdfDictionary assets = PdfNameTree.writeTree(assetsmap, writer);
        richMediaContent.put(PdfName.ASSETS, writer.addToBody(assets).getIndirectReference());
      }
      if (configurations.size() > 0) {
        richMediaContent.put(PdfName.CONFIGURATION, writer.addToBody(configurations).getIndirectReference());
      }
View Full Code Here

        expandNode(leaf);
      }
      return;
    case PdfObject.DICTIONARY:
    case PdfObject.STREAM:
      PdfDictionary dict = (PdfDictionary)object;
      for (PdfName element : dict.getKeys()) {
        leaf = PdfObjectTreeNode.getInstance(dict, element);
        addNodes(node, leaf);
        expandNode(leaf);
      }
      return;
View Full Code Here

   * to construct other objects (for instance the page table).
   * @param  object  an object we might want to store
   */
  private void store(PdfObject object) {
    if (object.isDictionary()){
      PdfDictionary dict = (PdfDictionary)object;
      if (PdfName.PAGE.equals(dict.get(PdfName.TYPE))) {
        objects.add(dict);
        return;
      }
    }
    objects.add(PdfNull.PDFNULL);
View Full Code Here

   * @param  node  a corresponding node
   */
  public OutlineTreeNode(PdfObjectTreeNode node) {
    super("outline.png");
    this.object_node = node;
    PdfDictionary dict = (PdfDictionary)node.getPdfObject();
    this.setUserObject(dict.get(PdfName.TITLE));
  }
View Full Code Here

   */
  public FormTreeNode(PdfObjectTreeNode node) {
    super("form.png");
    this.object_node = node;
    if (node.isDictionary()) {
      PdfDictionary dict = (PdfDictionary)node.getPdfObject();
      PdfObject fieldname = dict.get(PdfName.T);
      if (fieldname != null) {
        this.setUserObject(fieldname);
      }
      else {
        this.setUserObject("unnamed field");
View Full Code Here

     * @since 5.0.2
     */
    static public String getXObjectDetail(PdfDictionary resourceDic) throws IOException {
        StringBuilder sb = new StringBuilder();
       
        PdfDictionary xobjects = resourceDic.getAsDict(PdfName.XOBJECT);
        if (xobjects == null)
          return "No XObjects";
        for (PdfName entryName : xobjects.getKeys()) {
            PdfStream xobjectStream = xobjects.getAsStream(entryName);
           
            sb.append("------ " + entryName + " - subtype = " + xobjectStream.get(PdfName.SUBTYPE) + " = " + xobjectStream.getAsNumber(PdfName.LENGTH) + " bytes ------\n");
           
            if (!xobjectStream.get(PdfName.SUBTYPE).equals(PdfName.IMAGE)){
           
View Full Code Here

     * @throws IOException
     */
    static public void listContentStreamForPage(PdfReader reader, int pageNum, PrintWriter out) throws IOException {
        out.println("==============Page " + pageNum + "====================");
        out.println("- - - - - Dictionary - - - - - -");
        PdfDictionary pageDictionary = reader.getPageN(pageNum);
        out.println(getDictionaryDetail(pageDictionary));

        out.println("- - - - - XObject Summary - - - - - -");
        out.println(getXObjectDetail(pageDictionary.getAsDict(PdfName.RESOURCES)));
       
        out.println("- - - - - Content Stream - - - - - -");
        RandomAccessFileOrArray f = reader.getSafeFile();

        byte[] contentBytes = reader.getPageContent(pageNum, f);
View Full Code Here

    private final PdfName tag;
    private final PdfDictionary dictionary;
   
    public MarkedContentInfo(PdfName tag, PdfDictionary dictionary) {
        this.tag = tag;
        this.dictionary = dictionary != null ? dictionary : new PdfDictionary(); // I'd really prefer to make a defensive copy here to make this immutable
    }
View Full Code Here

TOP

Related Classes of com.itextpdf.text.pdf.PdfDictionary

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.