/** * Get table cell width from tc and table style from tbl and set it to xHTMLImporter. * @param tbl * @param tc * @param xHTMLImporter */ public static void setupMaxWidthAndStyleForTc(Tbl tbl, Tc tc, XHTMLImporter xHTMLImporter) { if(tc.getTcPr() != null && tc.getTcPr().getTcW() != null) { TblWidth tcW = tc.getTcPr().getTcW(); if (tcW.getW()!= null && tcW.getType().equals(TblWidth.TYPE_DXA)) { int maxWidth = tcW.getW().intValue(); String styleVal = null; if(tbl != null && tbl.getTblPr() != null && tbl.getTblPr().getTblStyle() != null) { styleVal = tbl.getTblPr().getTblStyle().getVal(); } log.debug("inserting in a tc, with maxwidth: " + maxWidth + ", and table style: " + styleVal); xHTMLImporter.setMaxWidth(maxWidth, styleVal); } else { log.debug("w:tcPr/w:tcW present, but width not in dxa units "); } } else { log.debug("w:tcPr/w:tcW not present"); } } }
try { results = xHTMLImporter.convert(toString(afip.getBuffer()), null);
xHTMLImporter.setSequenceCounters(sequenceCounters); xHTMLImporter.setMaxWidth(-1, null); // re-init if (bindingTraverserState.tcStack.peek() != null) { log.debug("inserting in a tc" ); xHTMLImporter.setHyperlinkStyle(BindingHandler.getHyperlinkResolver().getHyperlinkStyleId()); List<Object> results = null; try { results = xHTMLImporter.convert(r, baseUrl );
private void traverse(Box box, TableProperties tableProperties) throws Docx4JException { setDefaultFontSize(); traverse( box, null, tableProperties); unsetDefaultFontSize(); }
XHTMLImporter xi = new XHTMLImporter(); xi.setHyperlinkStyle("Hyperlink");
private void pushListItemStateStack() { // Init with current concrete list Numbering.Num currentConcreteList=null; if (peekListItemStateStack()!=null) { currentConcreteList = peekListItemStateStack().concreteList; } listItemStateStack.push(new ListItemContentState()); peekListItemStateStack().concreteList = currentConcreteList; }
public static Properties getProperties() { if (properties==null) {init();} return properties; }
public AtomicInteger getBookmarkIdLast() // actually, this returns that incremented by 1. { return bookmarkHelper.getBookmarkId(); }
private ContentAccessor getListForRun() { if (attachmentPointH!=null) return attachmentPointH; return getCurrentParagraph(true); }
protected static void addFontMapping(String cssFontFamily, RFonts rFonts) { fontFamilyToFont.put(cssFontFamily, rFonts); }
@Override public void setMaxWidth(int maxWidth, String tableStyle) { xHTMLImageHandler.setMaxWidth(maxWidth, tableStyle); }
public static void addFontMapping(String cssFontFamily, String font) { FontHandler.addFontMapping(cssFontFamily, font); }
public void setBookmarkIdNext(AtomicInteger val) { bookmarkHelper.setBookmarkId(val); }
protected static RFonts getRFonts(String cssFontFamily) { return fontFamilyToFont.get(cssFontFamily); }
protected AtomicInteger getBookmarkId() { if (bookmarkId==null) { // Work out starting ID bookmarkId = new AtomicInteger(initBookmarkIdStart()); } return bookmarkId; }
protected void pushListStack(BlockBox ca) { listStack.push(ca); pushListItemStateStack(); } protected BlockBox popListStack() {
/** * Useful if a unit test requires a certain property value. */ public static void setProperty(String key, String value) { if (properties==null) {init();} properties.setProperty(key, value); }
public static String getProperty(String key) { if (properties==null) {init();} return properties.getProperty(key); }
public static String getProperty(String key, String defaultValue) { if (properties==null) {init();} return properties.getProperty(key, defaultValue); }