protected XWPFStyle getXWPFStyle( XWPFParagraph paragraph ) { if ( paragraph == null ) { return null; } return getXWPFStyle( paragraph.getStyleID() ); } }
@Override protected IITextContainer startVisitPargraph( XWPFParagraph xwpfParagraph, IITextContainer pdfParagraph ) throws Exception { String styleID = xwpfParagraph.getStyleID(); if ( styleID != null ) { Style style = stylesMap.get( styleID ); if ( style == null ) { style = buildStyle( styleID ); } } return pdfParagraph; }
String styleClass = null; if (paragraph.getStyleID() != null && styles != null) { XWPFStyle style = styles.getStyle( paragraph.getStyleID() );
@Override protected IITextContainer startVisitPargraph( XWPFParagraph xwpfParagraph, IITextContainer pdfParagraph ) throws Exception { String styleID = xwpfParagraph.getStyleID(); if ( styleID != null ) { // FIXME : bad if styleID==null if ( !stylesMap.contains( styleID ) ) { buildStyle( styleID ); } // if (currentStyle == null) // currentStyle = style; // StyleParagraphProperties paragraphProperties = // style.getParagraphProperties(); } // TODO: elsewhere... // spacingAfter return pdfParagraph; }
public static List<String> getStyleIDs( XWPFParagraph paragraph ) String paragraphStyleId = paragraph.getStyleID(); boolean hasParagraphStyleId = StringUtils.isNotEmpty( paragraphStyleId ); if ( hasParagraphStyleId )
public static List<String> getStyleIDs( XWPFParagraph paragraph ) String paragraphStyleId = paragraph.getStyleID(); boolean hasParagraphStyleId = StringUtils.isNotEmpty( paragraphStyleId ); if ( hasParagraphStyleId )
private void applyStyles( XWPFParagraph ele, IStylableElement<XWPFParagraph> element ) { Style style = styleEngine.getStyle( ele.getStyleID() ); element.applyStyles( ele, style ); }
protected XHTMLPageContentBuffer startVisitPargraph( XWPFParagraph paragraph, XHTMLPageContentBuffer parentContainer ) throws Exception { styleEngine.startVisitPargraph( paragraph, null ); parentContainer.startElementNotEnclosed( P_ELEMENT ); if ( paragraph.getStyleID() != null ) { if ( LOGGER.isLoggable( Level.FINE ) ) { LOGGER.fine( "StyleID " + paragraph.getStyleID() ); } parentContainer.setAttribute( CLASS_ATTR, paragraph.getStyleID() ); } // HTML style StringBuilder htmlStyle = XHTMLStyleUtil.getStyle( paragraph, super.getXWPFStyle( paragraph.getStyleID() ), defaults ); setAttributStyleIfNeeded( parentContainer, htmlStyle ); parentContainer.endElementNotEnclosed(); return parentContainer; }
String paragraphStyleName = paragraph.getStyleID(); boolean sameStyleBelow = ( paragraphStyleName != null && paragraphStyleName.equals( previousParagraphStyleName ) );
String paragraphStyleName = paragraph.getStyleID(); boolean sameStyleBelow = ( paragraphStyleName != null && paragraphStyleName.equals( previousParagraphStyleName ) );
String paragraphStyleName = paragraph.getStyleID(); boolean sameStyleBelow = ( paragraphStyleName != null && paragraphStyleName.equals( previousParagraphStyleName ) );
this.currentRunAttributes = createClassAttribute( paragraph.getStyleID() );
this.currentRunAttributes = createClassAttribute( paragraph.getStyleID() );
@Override protected Object startVisitParagraph( XWPFParagraph paragraph, ListItemContext itemContext, Object parentContainer ) throws Exception { // 1) create attributes // 1.1) Create "class" attributes. AttributesImpl attributes = createClassAttribute( paragraph.getStyleID() ); // 1.2) Create "style" attributes. CTPPr pPr = paragraph.getCTP().getPPr(); CSSStyle cssStyle = getStylesDocument().createCSSStyle( pPr ); attributes = createStyleAttribute( cssStyle, attributes ); // 2) create element startElement( P_ELEMENT, attributes ); //To handle list items in paragraph if(itemContext != null) { startElement( SPAN_ELEMENT, attributes ); String text = itemContext.getText(); if ( StringUtils.isNotEmpty( text ) ) { text = StringUtils.replaceNonUnicodeChars(text); text = text + "\u0020"; SAXHelper.characters( contentHandler, StringEscapeUtils.escapeHtml( text ) ); } endElement( SPAN_ELEMENT ); } return null; }
AttributesImpl attributes = createClassAttribute( paragraph.getStyleID() );
String styleClass = null; if (paragraph.getStyleID() != null && styles != null) { XWPFStyle style = styles.getStyle( paragraph.getStyleID() );
String styleClass = null; if (paragraph.getStyleID() != null && styles != null) { XWPFStyle style = styles.getStyle( paragraph.getStyleID() );
CTRPr rprStyle = getRPr( super.getXWPFStyle( run.getParagraph().getStyleID() ) ); CTRPr rprDefault = getRPr( defaults );
AttributesImpl runAttributes = createClassAttribute( currentParagraph.getStyleID() );
AttributesImpl runAttributes = createClassAttribute( currentParagraph.getStyleID() );