本文整理了Java中org.apache.poi.xwpf.usermodel.XWPFDocument.getStyle()
方法的一些代码示例,展示了XWPFDocument.getStyle()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XWPFDocument.getStyle()
方法的具体详情如下:
包路径:org.apache.poi.xwpf.usermodel.XWPFDocument
类名称:XWPFDocument
方法名:getStyle
[英]Returns the styles object used
[中]返回使用的styles对象
代码示例来源:origin: fr.opensagres.xdocreport/org.apache.poi.xwpf.converter
public OLDXHTMLMapper( XWPFDocument document )
{
super();
this.document = document;
try
{
defaults = document.getStyle().getDocDefaults();
}
catch ( XmlException e )
{
LOGGER.severe( e.getMessage() );
}
catch ( IOException e )
{
LOGGER.severe( e.getMessage() );
}
}
代码示例来源:origin: fr.opensagres.xdocreport/org.apache.poi.xwpf.converter
public XWPFElementVisitor( XWPFDocument document )
{
this.document = document;
try
{
this.defaults = document.getStyle().getDocDefaults();
}
catch ( XmlException e )
{
LOGGER.severe( e.getMessage() );
}
catch ( IOException e )
{
LOGGER.severe( e.getMessage() );
}
}
代码示例来源:origin: fr.opensagres.xdocreport/org.apache.poi.xwpf.converter
@Override
protected IITextContainer startVisitDocument( OutputStream out )
throws Exception
{
// TODO parse default style here ?
CTStyles styles = document.getStyle();
styles.getDocDefaults().getPPrDefault().getPPr();
return null;
}
代码示例来源:origin: stackoverflow.com
XWPFDocument document = new XWPFDocument();
XWPFDocument template = new XWPFDocument(new FileInputStream(new File("Template.dotx")));
XWPFStyles newStyles = document.createStyles();
newStyles.setStyles(template.getStyle());
代码示例来源:origin: fr.opensagres.xdocreport/org.apache.poi.xwpf.converter.core
public XWPFStylesDocument( XWPFDocument document, boolean lazyInitialization )
throws XmlException, IOException
{
this( document.getStyle(), getFontsDocument( document ), getThemeDocuments( document ),
getCTSettings( document ), lazyInitialization );
}
代码示例来源:origin: fr.opensagres.xdocreport/org.apache.poi.xwpf.converter.core-gae
public XWPFStylesDocument( XWPFDocument document, boolean lazyInitialization )
throws XmlException, IOException
{
this( document.getStyle(), getFontsDocument( document ), getThemeDocuments( document ),
getCTSettings( document ), lazyInitialization );
}
代码示例来源:origin: stackoverflow.com
XWPFDocument template = new XWPFDocument(new FileInputStream(new File("Template.dotx")));
XWPFDocument doc = new XWPFDocument();
// let's copy styles from template to new doc
XWPFStyles newStyles = doc.createStyles();
newStyles.setStyles(template.getStyle());
XWPFParagraph para = doc.createParagraph();
para.setStyle("Heading1");
XWPFRun run = para.createRun();
run.setText("Heading 1");
return doc;
代码示例来源:origin: fr.opensagres.xdocreport/org.apache.poi.xwpf.converter
@Override
protected IITextContainer startVisitDocument( OutputStream out )
throws Exception
{
// TODO parse default style here ?
CTStyles styles = document.getStyle();
if ( generateCSSComments )
{
cssStyleSheet.setComment( "office:styles begin" );
}
styles.getDocDefaults().getPPrDefault().getPPr();
if ( generateCSSComments )
{
cssStyleSheet.setComment( "office:styles end" );
}
return null;
}
代码示例来源:origin: fr.opensagres.xdocreport/org.apache.poi.xwpf.converter
private void buildDefault()
{
try
{
CTDocDefaults defaults = document.getStyle().getDocDefaults();
// Style aStyle = new Style(DEFAULT_STYLE);
stylesMap.add( DEFAULT_STYLE );
cssStyleSheet.startCSSStyleDeclaration( DEFAULT_STYLE );
if ( defaults != null )
{
if ( defaults.getPPrDefault().getPPr() != null )
{
maptStyleParagraphProperties( defaults.getPPrDefault().getPPr() );
}
}
cssStyleSheet.endCSSStyleDeclaration();
// stylesMap.put(DEFAULT_STYLE, aStyle);
}
catch ( XmlException e )
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch ( IOException e )
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
代码示例来源:origin: fr.opensagres.xdocreport/org.apache.poi.xwpf.converter
private void buildDefault()
{
try
{
CTDocDefaults defaults = document.getStyle().getDocDefaults();
Style aStyle = new Style( DEFAULT_STYLE );
if ( defaults != null )
{
if ( defaults.getPPrDefault().getPPr() != null )
{
StyleParagraphProperties paragraphProperties =
mapStyleParagraphProperties( defaults.getPPrDefault().getPPr() );
aStyle.setParagraphProperties( paragraphProperties );
FontInfos fontInfos = processRPR( defaults.getRPrDefault().getRPr() );
paragraphProperties.setFontInfos( fontInfos );
}
}
stylesMap.put( DEFAULT_STYLE, aStyle );
}
catch ( XmlException e )
{
LOGGER.severe( e.getMessage() );
}
catch ( IOException e )
{
LOGGER.severe( e.getMessage() );
}
}
内容来源于网络,如有侵权,请联系作者删除!