• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java BreakType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.poi.xwpf.usermodel.BreakType的典型用法代码示例。如果您正苦于以下问题:Java BreakType类的具体用法?Java BreakType怎么用?Java BreakType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BreakType类属于org.apache.poi.xwpf.usermodel包,在下文中一共展示了BreakType类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: main

import org.apache.poi.xwpf.usermodel.BreakType; //导入依赖的package包/类
public static void main(String[] args) throws Exception
{
	XWPFDocument doc = new XWPFDocument();
       XWPFParagraph p = doc.createParagraph();
       
       String imgFile = "aspose.jpg";
       XWPFRun r = p.createRun();
       
       int format = XWPFDocument.PICTURE_TYPE_JPEG;
       r.setText(imgFile);
       r.addBreak();
       r.addPicture(new FileInputStream(imgFile), format, imgFile, Units.toEMU(200), Units.toEMU(200)); // 200x200 pixels
       r.addBreak(BreakType.PAGE);

    FileOutputStream out = new FileOutputStream("data/Apache_ImagesInDoc.docx");
    doc.write(out);
    out.close();
    
       System.out.println("Process Completed Successfully");
}
 
开发者ID:asposemarketplace,项目名称:Aspose_for_Apache_POI,代码行数:21,代码来源:ApacheInsertImage.java


示例2: main

import org.apache.poi.xwpf.usermodel.BreakType; //导入依赖的package包/类
public static void main(String[] args) throws Exception
{
	String dataPath = "src/featurescomparison/workingwithimages/insertimage/data/";

	XWPFDocument doc = new XWPFDocument();
       XWPFParagraph p = doc.createParagraph();
       
       String imgFile = dataPath + "aspose.jpg";
       XWPFRun r = p.createRun();
       
       int format = XWPFDocument.PICTURE_TYPE_JPEG;
       r.setText(imgFile);
       r.addBreak();
       r.addPicture(new FileInputStream(imgFile), format, imgFile, Units.toEMU(200), Units.toEMU(200)); // 200x200 pixels
       r.addBreak(BreakType.PAGE);

    FileOutputStream out = new FileOutputStream(dataPath + "Apache_ImagesInDoc_Out.docx");
    doc.write(out);
    out.close();
    
       System.out.println("Process Completed Successfully");
}
 
开发者ID:asposemarketplace,项目名称:Aspose_Words_for_Apache_POI,代码行数:23,代码来源:ApacheInsertImage.java


示例3: insertMPagination

import org.apache.poi.xwpf.usermodel.BreakType; //导入依赖的package包/类
/**
 * Insert the given {@link MPagination}.
 * 
 * @param paragraph
 *            the {@link XWPFParagraph} to modify
 * @param run
 *            the {@link XWPFRun} to insert to
 * @param mPagination
 *            the {@link MPagination}
 * @return the last inserted {@link XWPFParagraph}
 */
private XWPFParagraph insertMPagination(XWPFParagraph paragraph, XWPFRun run, MPagination mPagination) {
    final XWPFParagraph res;
    switch (mPagination) {
        case newColumn:
            run.addBreak(BreakType.COLUMN);
            res = paragraph;
            break;

        case newParagraph:
            res = createNewParagraph(generatedDocument, (XWPFParagraph) run.getParent());
            break;

        case newPage:
            run.addBreak(BreakType.PAGE);
            res = paragraph;
            break;

        case newTableOfContent:
            CTP ctP = paragraph.getCTP();
            CTSimpleField toc = ctP.addNewFldSimple();
            toc.setInstr("TOC \\h");
            toc.setDirty(STOnOff.TRUE);
            res = paragraph;
            break;

        case newTextWrapping:
            run.addBreak(BreakType.TEXT_WRAPPING);
            res = paragraph;
            break;

        default:
            throw new IllegalStateException("Not supported MPagination.");
    }

    return res;
}
 
开发者ID:ObeoNetwork,项目名称:M2Doc,代码行数:48,代码来源:M2DocEvaluator.java


示例4: addSourceTablesAppendix

import org.apache.poi.xwpf.usermodel.BreakType; //导入依赖的package包/类
private static void addSourceTablesAppendix(CustomXWPFDocument document, ETL etl) {
	XWPFParagraph paragraph = document.createParagraph();
	XWPFRun run = paragraph.createRun();
	run.addBreak(BreakType.PAGE);
	run.setText("Appendix: source tables");
	run.setFontSize(18);
	
	for (Table sourceTable : etl.getSourceDatabase().getTables()) {
		paragraph = document.createParagraph();
		run = paragraph.createRun();
		run.setText("Table: " + sourceTable.getName());
		run.setFontSize(14);
		
		createDocumentParagraph(document, sourceTable.getComment());
		
		XWPFTable table = document.createTable(sourceTable.getFields().size() + 1, 4);
		// table.setWidth(2000);
		XWPFTableRow header = table.getRow(0);
		setTextAndHeaderShading(header.getCell(0), "Field");
		setTextAndHeaderShading(header.getCell(1), "Type");
		setTextAndHeaderShading(header.getCell(2), "Most freq. value");
		setTextAndHeaderShading(header.getCell(3), "Comment");
		int rowNr = 1;
		for (Field sourceField : sourceTable.getFields()) {
			XWPFTableRow row = table.getRow(rowNr++);
			row.getCell(0).setText(sourceField.getName());
			row.getCell(1).setText(sourceField.getType());
			if (sourceField.getValueCounts() != null && sourceField.getValueCounts().length != 0)
				row.getCell(2).setText(sourceField.getValueCounts()[0][0]);
			createCellParagraph(row.getCell(3), sourceField.getComment().trim());
		}
		
	}
	
	run.setFontSize(18);
}
 
开发者ID:OHDSI,项目名称:WhiteRabbit,代码行数:37,代码来源:ETLDocumentGenerator.java


示例5: addNewPage

import org.apache.poi.xwpf.usermodel.BreakType; //导入依赖的package包/类
/**
 * 새로운 페이지로 넘긴다.
 */
public void addNewPage() {
	XWPFParagraph p = doc.createParagraph();
	XWPFRun r1 = p.createRun();
	r1.addBreak(BreakType.PAGE);
}
 
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:9,代码来源:MSWord.java



注:本文中的org.apache.poi.xwpf.usermodel.BreakType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DefaultBindingFactory类代码示例发布时间:2022-05-22
下一篇:
Java Messages类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap