gpt4 book ai didi

org.apache.poi.xslf.usermodel.XSLFTextParagraph.addNewTextRun()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-23 16:45:05 30 4
gpt4 key购买 nike

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

XSLFTextParagraph.addNewTextRun介绍

[英]Add a new run of text
[中]添加新的文本

代码示例

代码示例来源:origin: org.apache.poi/poi-ooxml

para.addLineBreak();
run = para.addNewTextRun();
run.setText(runText);
if (otherRPr != null) {

代码示例来源:origin: stackoverflow.com

XSLFTableRow headerRow = table.addRow();
 for(int i = 0; i < 3; i++) {
   XSLFTableCell th = headerRow.addCell();
   XSLFTextParagraph p = th.addNewTextParagraph();
   XSLFTextRun r = p.addNewTextRun();
   r.setText("Text");
 }

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

public void setText(String text){
  clearText();
  addNewTextParagraph().addNewTextRun().setText(text);
}

代码示例来源:origin: stackoverflow.com

tb.setVerticalAlignment(VerticalAlignment.DISTRIBUTED);
par.setTextAlign(TextAlign.CENTER);
XSLFTextRun run = par.addNewTextRun();
run.setText("unicode ->\u30B4\u30DF\u7BB1<-");
run.setFontFamily("GE Inspira");

代码示例来源:origin: stackoverflow.com

XSLFTableRow titleRow = tbl.addRow();
titleRow.setHeight(50);
XSLFTableCell titleCell1 = titleRow.addCell();
XSLFTextParagraph p1 = titleCell1.addNewTextParagraph();
p1.setTextAlign(TextAlign.CENTER);
XSLFTextRun r1 = p1.addNewTextRun();
r1.setText("Column title");
r1.setBold(true);
r1.setFontColor(new Color(0, 104, 145));
titleCell1.setFillColor(new Color(190, 230, 245));
r1.setFontSize(25.0);
titleCell1.setVerticalAlignment(VerticalAlignment.MIDDLE);

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

/**
 *  ensure that the paragraph contains at least one character.
 *  We need this trick to correctly measure text
 */
private void ensureNotEmpty(){
  XSLFTextRun r = addNewTextRun();
  r.setText(" ");
  CTTextCharacterProperties endPr = _p.getEndParaRPr();
  if(endPr != null) {
    if(endPr.isSetSz()) r.setFontSize(endPr.getSz() / 100);
  }
}

代码示例来源:origin: stackoverflow.com

tb.setVerticalAlignment(VerticalAlignment.DISTRIBUTED);
par.setTextAlign(TextAlign.CENTER);
XSLFTextRun run = par.addNewTextRun();
run.setText("/\u02CCin\u0259\u02C8v\u0101SH\u0259n/");
run.setFontFamily("DejaVu Serif");
run.setFontSize(12);
par.addLineBreak();
run = par.addNewTextRun();
run.setText("/\u02CCin\u0259\u02C8v\u0101SH\u0259n/");
run.setFontFamily("GE Inspira");

代码示例来源:origin: stackoverflow.com

textShape.clearText();
XSLFTextParagraph p = textShape.addNewTextParagraph();
XSLFTextRun r1 = p.addNewTextRun();
r1.setText("The");
r1.setFontColor(Color.blue);

代码示例来源:origin: org.apache.poi/poi-examples

public static void main(String[] args) throws IOException{
    try (XMLSlideShow ppt = new XMLSlideShow()) {
      XSLFSlide slide1 = ppt.createSlide();
      XSLFSlide slide2 = ppt.createSlide();

      XSLFTextBox shape1 = slide1.createTextBox();
      shape1.setAnchor(new Rectangle(50, 50, 200, 50));
      XSLFTextRun r1 = shape1.addNewTextParagraph().addNewTextRun();
      XSLFHyperlink link1 = r1.createHyperlink();
      r1.setText("http://poi.apache.org"); // visible text
      link1.setAddress("http://poi.apache.org");  // link address

      XSLFTextBox shape2 = slide1.createTextBox();
      shape2.setAnchor(new Rectangle(300, 50, 200, 50));
      XSLFTextRun r2 = shape2.addNewTextParagraph().addNewTextRun();
      XSLFHyperlink link2 = r2.createHyperlink();
      r2.setText("Go to the second slide"); // visible text
      link2.linkToSlide(slide2);  // link address

      try (FileOutputStream out = new FileOutputStream("hyperlinks.pptx")) {
        ppt.write(out);
      }
    }
  }
}

代码示例来源:origin: org.apache.poi/poi-examples

body2.addNewTextParagraph().addNewTextRun().setText("First paragraph");
body2.addNewTextParagraph().addNewTextRun().setText("Second paragraph");
body2.addNewTextParagraph().addNewTextRun().setText("Third paragraph");

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

para.addLineBreak();
run = para.addNewTextRun();
run.setText(runText);
if (otherRPr != null) {

代码示例来源:origin: org.apache.poi/poi-examples

XSLFTextRun r1 = p1.addNewTextRun();
r1.setText("Paragraph Formatting");
r1.setFontSize(24d);
XSLFTextRun r2 = p2.addNewTextRun();
r2.setText("Paragraph  properties apply to all text residing within the corresponding paragraph.");
r2.setFontSize(16d);
XSLFTextRun r3 = p3.addNewTextRun();
r3.setText("Run Formatting");
r3.setFontSize(24d);
p4.setSpaceBefore(-20d); // 20 pt from the previous paragraph
p4.setSpaceAfter(300d); // 3 lines after the paragraph
XSLFTextRun r4 = p4.addNewTextRun();
r4.setFontSize(16d);
r4.setText(

代码示例来源:origin: org.apache.poi/poi-examples

p1.setIndentLevel(0);
p1.setBullet(true);
XSLFTextRun r1 = p1.addNewTextRun();
r1.setText("Bullet1");
p2.setBulletCharacter("\u0075");
p2.setIndentLevel(1);
XSLFTextRun r2 = p2.addNewTextRun();
r2.setText("Bullet2");
p3.setBulletAutoNumber(AutoNumberingScheme.alphaLcParenRight, 1);
p3.setIndentLevel(2);
XSLFTextRun r3 = p3.addNewTextRun();
r3.setText("Numbered List Item - 1");
p4.setBulletAutoNumber(AutoNumberingScheme.alphaLcParenRight, 2);
p4.setIndentLevel(2);
XSLFTextRun r4 = p4.addNewTextRun();
r4.setText("Numbered List Item - 2");
p5.setBulletAutoNumber(AutoNumberingScheme.alphaLcParenRight, 3);
p5.setIndentLevel(2);
XSLFTextRun r5 = p5.addNewTextRun();
r5.setText("Numbered List Item - 3");

代码示例来源:origin: org.apache.poi/poi-examples

XSLFTextParagraph p1 = bodyPlaceholder.addNewTextParagraph();
p1.setIndentLevel(0);
p1.addNewTextRun().setText("Level1 text");
XSLFTextParagraph p2 = bodyPlaceholder.addNewTextParagraph();
p2.setIndentLevel(1);
p2.addNewTextRun().setText("Level2 text");
XSLFTextParagraph p3 = bodyPlaceholder.addNewTextParagraph();
p3.setIndentLevel(2);
p3.addNewTextRun().setText("Level3 text");

代码示例来源:origin: org.apache.poi/poi-examples

XSLFTextParagraph p = th.addNewTextParagraph();
p.setTextAlign(TextAlign.CENTER);
XSLFTextRun r = p.addNewTextRun();
r.setText("Header " + (i + 1));
r.setBold(true);
  XSLFTableCell cell = tr.addCell();
  XSLFTextParagraph p = cell.addNewTextParagraph();
  XSLFTextRun r = p.addNewTextRun();

代码示例来源:origin: stackoverflow.com

Color fontColor = null;
String fontFamily = null;
double fontSize = 0.0;
boolean italic = false;
boolean bold = false;
boolean underline = false;
for (XSLFTextParagraph paragraph : autoShape.getTextParagraphs()) {
  for (XSLFTextRun text : paragraph.getTextRuns()) {
    fontColor = text.getFontColor();
    fontFamily = text.getFontFamily();
    fontSize = text.getFontSize();
    italic = text.isItalic();
    bold = text.isBold();
    underline = text.isUnderline();
  }
}
autoShape.clearText();
XSLFTextParagraph addNewTextParagraph = autoShape.addNewTextParagraph();

XSLFTextRun addNewTextRun = addNewTextParagraph.addNewTextRun();
addNewTextRun.setText(values.get(0)[1]);
addNewTextRun.setFontColor(fontColor);
addNewTextRun.setFontFamily(fontFamily);
addNewTextRun.setFontSize(fontSize);
addNewTextRun.setItalic(italic);
addNewTextRun.setBold(bold);
addNewTextRun.setUnderline(underline);

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com