com.lowagie.text.Phrase.getChunks()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(165)

本文整理了Java中com.lowagie.text.Phrase.getChunks()方法的一些代码示例,展示了Phrase.getChunks()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Phrase.getChunks()方法的具体详情如下:
包路径:com.lowagie.text.Phrase
类名称:Phrase
方法名:getChunks

Phrase.getChunks介绍

[英]Gets all the chunks in this element.
[中]获取此元素中的所有块。

代码示例

代码示例来源:origin: fr.opensagres.xdocreport.itext-gae/itext-gae

/**
 * Returns the content as a String object.
 * This method differs from toString because toString will return an ArrayList with the toString value of the Chunks in this Phrase.
 */
public String getContent() {
  StringBuffer buf = new StringBuffer();
  for (Iterator i = getChunks().iterator(); i.hasNext(); ) {
    buf.append(i.next().toString());
  }
  return buf.toString();
}

代码示例来源:origin: es.gob.afirma/afirma-crypto-pdf-itext

/**
 * Returns the content as a String object.
 * This method differs from toString because toString will return an ArrayList with the toString value of the Chunks in this Phrase.
 */
public String getContent() {
  StringBuffer buf = new StringBuffer();
  for (Iterator i = getChunks().iterator(); i.hasNext(); ) {
    buf.append(i.next().toString());
  }
  return buf.toString();
}

代码示例来源:origin: com.github.librepdf/openpdf

/**
 * Returns the content as a String object.
 * This method differs from toString because toString will return an ArrayList with the toString value of the Chunks in this Phrase.
 */
public String getContent() {
  StringBuffer buf = new StringBuffer();
  for (Iterator i = getChunks().iterator(); i.hasNext(); ) {
    buf.append(i.next().toString());
  }
  return buf.toString();
}

代码示例来源:origin: com.github.librepdf/openpdf

/**
 * Adds a <CODE>Phrase</CODE> to the current text array.
 * @param phrase the text
 */
public void addText(Phrase phrase) {
  for (Iterator j = phrase.getChunks().iterator(); j.hasNext();) {
    chunks.add(new PdfChunk((Chunk)j.next(), null));
  }
}

代码示例来源:origin: com.github.linkeer8802/api-resolver-core

public static void setLocalGoto(Phrase phrase, String localGoto) {
  for (Object elmt : phrase.getChunks()) {
    ((Chunk) elmt).setLocalGoto(localGoto);
  };
}

代码示例来源:origin: com.github.linkeer8802/api-resolver-core

public static void setLocalDestination(Phrase phrase, String destination) {
    for (Object elmt : phrase.getChunks()) {
      ((Chunk) elmt).setLocalDestination(destination);
    };
  }
}

代码示例来源:origin: es.gob.afirma/afirma-crypto-pdf-itext

/**
 * Adds a <CODE>Phrase</CODE> to the current text array.
 * @param phrase the text
 */
public void addText(Phrase phrase) {
  for (Iterator j = phrase.getChunks().iterator(); j.hasNext();) {
    chunks.add(new PdfChunk((Chunk)j.next(), null));
  }
}

代码示例来源:origin: fr.opensagres.xdocreport.itext-gae/itext-gae

/**
 * Adds a <CODE>Phrase</CODE> to the current text array.
 * @param phrase the text
 */
public void addText(Phrase phrase) {
  for (Iterator j = phrase.getChunks().iterator(); j.hasNext();) {
    chunks.add(new PdfChunk((Chunk)j.next(), null));
  }
}

代码示例来源:origin: es.gob.afirma/afirma-crypto-pdf-itext

private void addWaitingPhrase() {
  if (bidiLine == null && waitPhrase != null) {
    bidiLine = new BidiLine();
    for (Iterator j = waitPhrase.getChunks().iterator(); j.hasNext();) {
      bidiLine.addChunk(new PdfChunk((Chunk)j.next(), null));
    }
    waitPhrase = null;
  }
}

代码示例来源:origin: com.github.librepdf/openpdf

private void addWaitingPhrase() {
  if (bidiLine == null && waitPhrase != null) {
    bidiLine = new BidiLine();
    for (Iterator j = waitPhrase.getChunks().iterator(); j.hasNext();) {
      bidiLine.addChunk(new PdfChunk((Chunk)j.next(), null));
    }
    waitPhrase = null;
  }
}

代码示例来源:origin: fr.opensagres.xdocreport.itext-gae/itext-gae

private void addWaitingPhrase() {
  if (bidiLine == null && waitPhrase != null) {
    bidiLine = new BidiLine();
    for (Iterator j = waitPhrase.getChunks().iterator(); j.hasNext();) {
      bidiLine.addChunk(new PdfChunk((Chunk)j.next(), null));
    }
    waitPhrase = null;
  }
}

代码示例来源:origin: org.seasar.tuigwaa/tuigwaa-cms

private String getChildAsString(SimpleNode node, Object data, int idx) {
  StringBuffer buf = new StringBuffer();
  for (int i = idx; i < node.jjtGetNumChildren(); i++) {
    Object o = node.jjtGetChild(i).jjtAccept(this, data);
    if (o instanceof Chunk) {
      buf.append(((Chunk) o).content());
    } else if (o instanceof Phrase) {
      for (Iterator itr = ((Phrase) o).getChunks().iterator(); itr
          .hasNext();) {
        buf.append(((Chunk) itr.next()).content());
      }
    } else {
    }
  }
  return buf.toString();
}

代码示例来源:origin: com.github.librepdf/openpdf

/**
 * Adds a <CODE>Phrase</CODE> to the current text array.
 * Will not have any effect if addElement() was called before.
 * 
 * @param phrase the text
 */
public void addText(Phrase phrase) {
  if (phrase == null || composite)
    return;
  addWaitingPhrase();
  if (bidiLine == null) {
    waitPhrase = phrase;
    return;
  }
  for (Iterator j = phrase.getChunks().iterator(); j.hasNext();) {
    bidiLine.addChunk(new PdfChunk((Chunk)j.next(), null));
  }
}

代码示例来源:origin: es.gob.afirma/afirma-crypto-pdf-itext

/**
 * Adds a <CODE>Phrase</CODE> to the current text array.
 * Will not have any effect if addElement() was called before.
 * 
 * @param phrase the text
 */
public void addText(Phrase phrase) {
  if (phrase == null || composite)
    return;
  addWaitingPhrase();
  if (bidiLine == null) {
    waitPhrase = phrase;
    return;
  }
  for (Iterator j = phrase.getChunks().iterator(); j.hasNext();) {
    bidiLine.addChunk(new PdfChunk((Chunk)j.next(), null));
  }
}

代码示例来源:origin: fr.opensagres.xdocreport.itext-gae/itext-gae

/**
 * Adds a <CODE>Phrase</CODE> to the current text array.
 * Will not have any effect if addElement() was called before.
 * 
 * @param phrase the text
 */
public void addText(Phrase phrase) {
  if (phrase == null || composite)
    return;
  addWaitingPhrase();
  if (bidiLine == null) {
    waitPhrase = phrase;
    return;
  }
  for (Iterator j = phrase.getChunks().iterator(); j.hasNext();) {
    bidiLine.addChunk(new PdfChunk((Chunk)j.next(), null));
  }
}

代码示例来源:origin: org.seasar.tuigwaa/tuigwaa-ext

public Object doPDFView(CmsRequest request, CmsResponse response, PluginRequest prequest) throws PluginException {
      
  String[] array = prequest.getArgs();
  Object child = prequest.getChild();
  
  if(array == null) return child;
  
  if(array.length >= 1){
    String sizestr = array[0].replaceAll("px|PX|pX|Px","");
    float size = Float.parseFloat(sizestr);			
  
    if(child instanceof Phrase){
      Phrase p = (Phrase) child;
      List list = p.getChunks();
      if(list != null){
        for(Iterator i = list.iterator();i.hasNext();){
          Chunk c = (Chunk)i.next();
          Font nf = new Font(c.font());
          nf.setSize(size);
          c.setFont(nf);
        }
      }
    }
  }
  return child;
}

代码示例来源:origin: org.seasar.tuigwaa/tuigwaa-ext

public Object doPDFView(CmsRequest request, CmsResponse response, PluginRequest prequest) throws PluginException {
  
  String[] array = prequest.getArgs();
  Object child = prequest.getChild();
  
  if(array == null) return child;
  
  if(array.length >= 1){
    String colorstr = array[0];
    String bgcolorstr = null;
    if(array.length >= 2) bgcolorstr = array[1];
    
  
    if(child instanceof Phrase){
      Phrase p = (Phrase) child;
      List list = p.getChunks();
      if(list != null){
        for(Iterator i = list.iterator();i.hasNext();){
          Chunk c = (Chunk)i.next();
          Font nf = new Font(c.font());
          nf.setColor(VisitorUtils.getColorByString(colorstr,true));
          if(bgcolorstr !=null)
            c.setBackground(VisitorUtils.getColorByString(bgcolorstr,false));
          c.setFont(nf);
        }
      }
    }
  }
  return child;				
}

代码示例来源:origin: fr.opensagres.xdocreport/org.odftoolkit.odfdom.converter.pdf

if ( symbolFont.isStandardFont() )
  ArrayList<Chunk> chunks = p.getChunks();
  for ( Chunk chunk : chunks )

代码示例来源:origin: fr.opensagres.xdocreport/fr.opensagres.odfdom.converter.pdf

if ( symbolFont.isStandardFont() )
  ArrayList<Chunk> chunks = p.getChunks();
  for ( Chunk chunk : chunks )

相关文章