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() ); } }
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() ); } }
@Override protected IITextContainer startVisitDocument( OutputStream out ) throws Exception { // TODO parse default style here ? CTStyles styles = document.getStyle(); styles.getDocDefaults().getPPrDefault().getPPr(); return null; }
XWPFDocument document = new XWPFDocument(); XWPFDocument template = new XWPFDocument(new FileInputStream(new File("Template.dotx"))); XWPFStyles newStyles = document.createStyles(); newStyles.setStyles(template.getStyle());
public XWPFStylesDocument( XWPFDocument document, boolean lazyInitialization ) throws XmlException, IOException { this( document.getStyle(), getFontsDocument( document ), getThemeDocuments( document ), getCTSettings( document ), lazyInitialization ); }
public XWPFStylesDocument( XWPFDocument document, boolean lazyInitialization ) throws XmlException, IOException { this( document.getStyle(), getFontsDocument( document ), getThemeDocuments( document ), getCTSettings( document ), lazyInitialization ); }
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;
@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; }
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(); } }
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() ); } }