本文整理匯總了Java中org.docx4j.wml.STLineSpacingRule類的典型用法代碼示例。如果您正苦於以下問題:Java STLineSpacingRule類的具體用法?Java STLineSpacingRule怎麽用?Java STLineSpacingRule使用的例子?那麽恭喜您, 這裏精選的類代碼示例或許可以為您提供幫助。

STLineSpacingRule類屬於org.docx4j.wml包,在下文中一共展示了STLineSpacingRule類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於我們的係統推薦出更棒的Java代碼示例。

示例1: setStyleMLA

​點讚 3

import org.docx4j.wml.STLineSpacingRule; //導入依賴的package包/類

void setStyleMLA(Style style, boolean justify) {

ObjectFactory factory = Context.getWmlObjectFactory();

PPr paragraphProperties = factory.createPPr();

Jc justification = factory.createJc();

if (justify)

justification.setVal(JcEnumeration.BOTH);

else

justification.setVal(JcEnumeration.CENTER);

paragraphProperties.setJc(justification);

Spacing sp = factory.createPPrBaseSpacing();

sp.setAfter(BigInteger.ZERO);

sp.setBefore(BigInteger.ZERO);

sp.setLine(BigInteger.valueOf(482));

sp.setLineRule(STLineSpacingRule.AUTO);

paragraphProperties.setSpacing(sp);

style.setPPr(paragraphProperties);

RPr rpr = new RPr();

changeFont(rpr, "Times New Roman");

style.setRPr(rpr);

}

開發者ID:anubiann00b,項目名稱:TextToDocx,代碼行數:27,

示例2: addTableCell

​點讚 2

import org.docx4j.wml.STLineSpacingRule; //導入依賴的package包/類

public void addTableCell(ObjectFactory factory,

WordprocessingMLPackage wordMLPackage, Tr tableRow, String content,

RPr rpr, JcEnumeration jcEnumeration, boolean hasBgColor,

String backgroudColor) {

Tc tableCell = factory.createTc();

P p = factory.createP();

setParagraphSpacing(factory, p, jcEnumeration, true, "0", "0", null,

null, true, "240", STLineSpacingRule.AUTO);

Text t = factory.createText();

t.setValue(content);

R run = factory.createR();

// 設置表格內容字體樣式

run.setRPr(rpr);

TcPr tcPr = tableCell.getTcPr();

if (tcPr == null) {

tcPr = factory.createTcPr();

}

CTVerticalJc valign = factory.createCTVerticalJc();

valign.setVal(STVerticalJc.CENTER);

tcPr.setVAlign(valign);

run.getContent().add(t);

p.getContent().add(run);

tableCell.getContent().add(p);

if (hasBgColor) {

CTShd shd = tcPr.getShd();

if (shd == null) {

shd = factory.createCTShd();

}

shd.setColor("auto");

shd.setFill(backgroudColor);

tcPr.setShd(shd);

}

tableCell.setTcPr(tcPr);

tableRow.getContent().add(tableCell);

}

開發者ID:vindell,項目名稱:docx4j-template,代碼行數:39,

示例3: testCreateComment

​點讚 2

import org.docx4j.wml.STLineSpacingRule; //導入依賴的package包/類

public void testCreateComment(WordprocessingMLPackage wordMLPackage,

MainDocumentPart t, ObjectFactory factory) throws Exception {

P p = factory.createP();

setParagraphSpacing(factory, p, true, "0",

"0",true, null, "100", true, "240", STLineSpacingRule.AUTO);

t.addObject(p);

RPr fontRPr = getRPrStyle(factory, "微軟雅黑", "000000", "20",

STHint.EAST_ASIA, false, false, false, true, UnderlineEnumeration.SINGLE, "B61CD2",

true, "darkYellow", false, null, null, null);

RPr commentRPr = getRPrStyle(factory, "微軟雅黑", "41A62D", "18",

STHint.EAST_ASIA, true, true, false, false, null, null, false,

null, false, null, null, null);

Comments comments = addDocumentCommentsPart(wordMLPackage, factory);

BigInteger commentId = BigInteger.valueOf(1);

createCommentEnd(factory, p, "測試", "這是官網Demo", fontRPr, commentRPr, commentId, comments);

commentId = commentId.add(BigInteger.ONE);

createCommentRound(factory, p, "批注", "這是批注comment", fontRPr, commentRPr, commentId, comments);

commentId = commentId.add(BigInteger.ONE);

p = factory.createP();

setParagraphSpacing(factory, p, true, "0",

"0",true, null, "100", true, "240", STLineSpacingRule.AUTO);

t.addObject(p);

createCommentRound(factory, p, "批注2", "這是批注comment2", fontRPr, commentRPr, commentId, comments);

commentId = commentId.add(BigInteger.ONE);

createCommentEnd(factory, p, "測試2", "這是官網Demo", fontRPr, commentRPr, commentId, comments);

commentId = commentId.add(BigInteger.ONE);

}

開發者ID:vindell,項目名稱:docx4j-template,代碼行數:32,

示例4: setParagraphSpacing

​點讚 2

import org.docx4j.wml.STLineSpacingRule; //導入依賴的package包/類

public void setParagraphSpacing(ObjectFactory factory, P p,

boolean isSpace, String before, String after, boolean isLines,

String beforeLines, String afterLines, boolean isLineRule,

String lineValue, STLineSpacingRule sTLineSpacingRule) {

PPr pPr = p.getPPr();

if (pPr == null) {

pPr = factory.createPPr();

}

Spacing spacing = new Spacing();

if (isSpace) {

if (before != null) {

// 段前磅數

spacing.setBefore(new BigInteger(before));

}

if (after != null) {

// 段後磅數

spacing.setAfter(new BigInteger(after));

}

}

if (isLines) {

if (beforeLines != null) {

// 段前行數

spacing.setBeforeLines(new BigInteger(beforeLines));

}

if (afterLines != null) {

// 段後行數

spacing.setAfterLines(new BigInteger(afterLines));

}

}

if (isLineRule) {

if (lineValue != null) {

spacing.setLine(new BigInteger(lineValue));

}

spacing.setLineRule(sTLineSpacingRule);

}

pPr.setSpacing(spacing);

p.setPPr(pPr);

}

開發者ID:vindell,項目名稱:docx4j-template,代碼行數:39,

示例5: headingSpacing

​點讚 2

import org.docx4j.wml.STLineSpacingRule; //導入依賴的package包/類

private Spacing headingSpacing() {

final Spacing spacing = this.wmlObjectFactory.createPPrBaseSpacing();

spacing.setBefore(BigInteger.valueOf(240));

spacing.setAfter(BigInteger.valueOf(240));

spacing.setLine(BigInteger.valueOf(240));

spacing.setLineRule(STLineSpacingRule.AUTO);

return spacing;

}

開發者ID:mizitch,項目名稱:story-inspector,代碼行數:9,

示例6: bodySpacing

​點讚 2

import org.docx4j.wml.STLineSpacingRule; //導入依賴的package包/類

private Spacing bodySpacing() {

final Spacing spacing = this.wmlObjectFactory.createPPrBaseSpacing();

spacing.setBefore(BigInteger.valueOf(0));

spacing.setAfter(BigInteger.valueOf(144));

spacing.setLine(BigInteger.valueOf(240));

spacing.setLineRule(STLineSpacingRule.AUTO);

return spacing;

}

開發者ID:mizitch,項目名稱:story-inspector,代碼行數:9,

示例7: createHyperlink

​點讚 2

import org.docx4j.wml.STLineSpacingRule; //導入依賴的package包/類

public void createHyperlink(WordprocessingMLPackage wordMLPackage,

MainDocumentPart t, ObjectFactory factory,P paragraph, String url,

String value, String fontName, String fontSize,JcEnumeration jcEnumeration) throws Exception {

org.docx4j.relationships.ObjectFactory reFactory = new org.docx4j.relationships.ObjectFactory();

org.docx4j.relationships.Relationship rel = reFactory

.createRelationship();

rel.setType(Namespaces.HYPERLINK);

rel.setTarget(url);

rel.setTargetMode("External");

t.getRelationshipsPart().addRelationship(rel);

StringBuffer sb = new StringBuffer();

// addRelationship sets the rel's @Id

sb.append("

sb.append(rel.getId());

sb.append("\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" ");

sb.append("xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" >");

sb.append("");

sb.append("

sb.append(fontName);

sb.append("\" w:hAnsi=\"");

sb.append(fontName);

sb.append("\" w:eastAsia=\"");

sb.append(fontName);

sb.append("\" w:hint=\"eastAsia\"/>");

sb.append("

sb.append(fontSize);

sb.append("\"/>

sb.append(fontSize);

sb.append("\"/>");

sb.append(value);

sb.append("

");

Hyperlink link = (Hyperlink) XmlUtils.unmarshalString(sb.toString());

paragraph.getContent().add(link);

setParagraphSpacing(factory, paragraph, jcEnumeration, true, "0",

"0", null, null, true, "240", STLineSpacingRule.AUTO);

PPr ppr = paragraph.getPPr();

if (ppr == null) {

ppr = factory.createPPr();

}

RFonts fonts = new RFonts();

fonts.setAscii("微軟雅黑");

fonts.setHAnsi("微軟雅黑");

fonts.setEastAsia("微軟雅黑");

fonts.setHint(STHint.EAST_ASIA);

ParaRPr rpr = new ParaRPr();

rpr.setRFonts(fonts);

ppr.setRPr(rpr);

paragraph.setPPr(ppr);

}

開發者ID:vindell,項目名稱:docx4j-template,代碼行數:51,

示例8: addTableCell

​點讚 2

import org.docx4j.wml.STLineSpacingRule; //導入依賴的package包/類

public void addTableCell(ObjectFactory factory,

WordprocessingMLPackage wordMLPackage, Tr tableRow, String content,

RPr rpr, JcEnumeration jcEnumeration, boolean hasBgColor,

String backgroudColor) {

Tc tableCell = factory.createTc();

P p = factory.createP();

setParagraphAlign(factory, p, jcEnumeration);

Text t = factory.createText();

t.setValue(content);

R run = factory.createR();

// 設置表格內容字體樣式

run.setRPr(rpr);

TcPr tcPr = tableCell.getTcPr();

if (tcPr == null) {

tcPr = factory.createTcPr();

}

CTVerticalJc valign = factory.createCTVerticalJc();

valign.setVal(STVerticalJc.CENTER);

tcPr.setVAlign(valign);

run.getContent().add(t);

p.getContent().add(run);

PPr ppr=p.getPPr();

if(ppr==null){

ppr=factory.createPPr();

}

//設置段後距離

Spacing spacing=new Spacing();

spacing.setAfter(new BigInteger("0"));

spacing.setLineRule(STLineSpacingRule.AUTO);

ppr.setSpacing(spacing);

p.setPPr(ppr);

tableCell.getContent().add(p);

if (hasBgColor) {

CTShd shd = tcPr.getShd();

if (shd == null) {

shd = factory.createCTShd();

}

shd.setColor("auto");

shd.setFill(backgroudColor);

tcPr.setShd(shd);

tableCell.setTcPr(tcPr);

}

tableRow.getContent().add(tableCell);

}

開發者ID:vindell,項目名稱:docx4j-template,代碼行數:50,

注:本文中的org.docx4j.wml.STLineSpacingRule類示例整理自Github/MSDocs等源碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。

java linest_Java STLineSpacingRule類代碼示例相关推荐

  1. java uiautomation_Java UiAutomation類代碼示例

    本文整理匯總了Java中android.app.UiAutomation類的典型用法代碼示例.如果您正苦於以下問題:Java UiAutomation類的具體用法?Java UiAutomation怎 ...

  2. java nifty_Java NiftyDialogBuilder類代碼示例

    本文整理匯總了Java中com.gitonway.lee.niftymodaldialogeffects.NiftyDialogBuilder類的典型用法代碼示例.如果您正苦於以下問題:Java Ni ...

  3. java intfunction_Java IntFunction類代碼示例

    本文整理匯總了Java中java.util.function.IntFunction類的典型用法代碼示例.如果您正苦於以下問題:Java IntFunction類的具體用法?Java IntFunct ...

  4. java sentence_Java Sentence類代碼示例

    本文整理匯總了Java中aima.core.logic.propositional.parsing.ast.Sentence類的典型用法代碼示例.如果您正苦於以下問題:Java Sentence類的具 ...

  5. java scene_Java Scene類代碼示例

    本文整理匯總了Java中com.sun.j3d.loaders.Scene類的典型用法代碼示例.如果您正苦於以下問題:Java Scene類的具體用法?Java Scene怎麽用?Java Scene ...

  6. java notifier_Java Notifier類代碼示例

    本文整理匯總了Java中org.apache.maven.model.Notifier類的典型用法代碼示例.如果您正苦於以下問題:Java Notifier類的具體用法?Java Notifier怎麽 ...

  7. java bidi_Java Bidi類代碼示例

    本文整理匯總了Java中java.text.Bidi類的典型用法代碼示例.如果您正苦於以下問題:Java Bidi類的具體用法?Java Bidi怎麽用?Java Bidi使用的例子?那麽恭喜您, 這 ...

  8. java datarow_Java DataRow類代碼示例

    本文整理匯總了Java中org.apache.cayenne.DataRow類的典型用法代碼示例.如果您正苦於以下問題:Java DataRow類的具體用法?Java DataRow怎麽用?Java ...

  9. java hessian2_Java Hessian2Output類代碼示例

    本文整理匯總了Java中com.caucho.hessian.io.Hessian2Output類的典型用法代碼示例.如果您正苦於以下問題:Java Hessian2Output類的具體用法?Java ...

最新文章

  1. html中for标记,C#使用for循环移除HTML标记
  2. php敏感字符串过滤_PHP代码审计入门:常见的危险函数和审计点
  3. Bug输出Excel图片不显示
  4. linux 查看用户上次修改密码的日期
  5. ios(safar/微信)返回不执行js
  6. mysql是单核吗_一次单核CPU占用过高问题的处理
  7. 中国水泥板市场趋势报告、技术动态创新及市场预测
  8. POJ 2663 Tri Tiling dp 画图找规律
  9. Centos7下SRS流式服务器搭建、推流、拉流
  10. Redis 6.0 源码阅读笔记(0) -- Redis 哈希表和字典 铺垫
  11. 使用一般处理程序HTTPHandler下载文件
  12. 创造思维方法训练_数学思维方法训练课程:每日一题11.23
  13. jxls对比_JXLS 2.4.0学习
  14. 射频芯片设计EM仿真(二)--对比EM仿真和schmetic仿真
  15. 阿基里斯与乌龟的悖论
  16. Leco题目:回文数
  17. 小甲鱼python入门笔记(一)(全)
  18. node获取系统字体
  19. 微信小程序怎么添加到主屏幕将微信小程序放到手机桌面?
  20. logo制作软件有哪些?这些好用的logo制作软件别错过。​

热门文章

  1. 安卓 调用QQ加群代码
  2. C# 汉字转拼音 使用微软的Visual Studio International Pack 类库提取汉字拼音首字母...
  3. [转贴] 扫盲转贴:Rootkit技术发展史
  4. Java经典面试:源码解读及如何保证线程安全
  5. 多目标进化算法(MOEAs)概述
  6. k8s 配置 Secret 集成Harbor
  7. docker启动容器指定主机名,网络和ip地址
  8. 双搜----用两只眼睛看世界
  9. FRM P1B4笔记:Valuation and Risk Models
  10. 刀片服务器改台式电脑_一种刀片服务器机箱的制作方法