当前位置: 首页>>代码示例>>Java>>正文


Java BreakType类代码示例

本文整理汇总了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;未经允许,请勿转载。