类 DocxUtil
java.lang.Object
org.anyline.office.docx.util.DocxUtil
-
字段概要
字段修饰符和类型字段说明static final doublestatic final intstatic final intstatic final intstatic final doublestatic final double -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static voidaddAttribute(org.dom4j.Element element, String key, String value) static org.dom4j.ElementaddElement(org.dom4j.Element parent, String tag) static org.dom4j.ElementaddElement(org.dom4j.Element parent, String tag, String key, String value) 添加element及属性static voidstatic voidafter(org.dom4j.Element src, org.dom4j.Element ref) src插入到ref之后static voidbackground(org.dom4j.Element pr, Map<String, String> styles) static voidbefore(org.dom4j.Element src, org.dom4j.Element ref) src插入到ref之前static List<org.dom4j.Element>static org.dom4j.Elementstatic voidstatic voidstatic final intcm2dxa(double cm) static final doublecm2pt(double cm) static final doublecm2px(double cm) static voidcopyStyle(org.dom4j.Element src, org.dom4j.Element copy) static voidcopyStyle(org.dom4j.Element src, org.dom4j.Element copy, boolean override) copy的样式复制给srcstatic int宽度计算static final doubledxa2emu(double dxa) static final doubledxa2pt(double dxa) static final doubledxa2px(double dxa) static final doubleemu2px(double emu) static voidstatic intstatic org.dom4j.Element获取element的上一级中第一个标签名=tag的上级static booleanstatic final doublein2pt(double in) static final doublein2px(double in) static intindex(org.dom4j.Element element) 当前节点在上级节点的下标static booleanstatic booleanisEmpty(org.dom4j.Element element) static org.dom4j.Elementlast(org.dom4j.Element element) static StringlastName(org.dom4j.Element element) static String根据关键字查找样式列表IDlistStyles(File docx) 根据关键字查找样式列表IDstatic void合并文件(只合并内容document.xml)合并到第一个文件中static Stringstatic final doublemm2pt(double mm) static final doublemm2px(double mm) static org.dom4j.Elementnext(org.dom4j.Element parent, org.dom4j.Element child) static org.dom4j.ElementnextByName(org.dom4j.Element element) static org.dom4j.ElementnextByName(org.dom4j.Element parent, org.dom4j.Element element) static voidstatic voidstatic org.dom4j.Elementstatic org.dom4j.Elementstatic org.dom4j.Elementprev(org.dom4j.Element element) 前一个节点static org.dom4j.Elementprev(org.dom4j.Element parent, org.dom4j.Element child) static org.dom4j.ElementprevByName(org.dom4j.Element element) 前一个节点static org.dom4j.ElementprevByName(org.dom4j.Element parent, org.dom4j.Element element) static StringprevName(org.dom4j.Element element) static final doublept2cm(double in) static final intpt2dxa(double pt) static final doublept2in(double pt) static final doublept2mm(double mm) static final doublept2px(double pt) static final doublepx2cm(double px) static final intpx2dxa(double px) static final intpx2dxa(int px) static final intpx2emu(int px) static final doublepx2in(double px) static final doublepx2mm(double px) static final doublepx2pt(double px) static voidremoveAttribute(org.dom4j.Element element, String attribute) static voidremoveContent(org.dom4j.Element parent) static voidremoveElement(org.dom4j.Element parent, String element) static void拆分关键字 拆分123${key}abc成多个w:tstatic Stringtext(org.dom4j.Element element) 当前节点下的文本static org.dom4j.Elementtop(org.dom4j.Element element) static String
-
字段详细资料
-
PT_PER_PX
public static final double PT_PER_PX- 另请参阅:
-
IN_PER_PT
public static final int IN_PER_PT- 另请参阅:
-
CM_PER_PT
public static final double CM_PER_PT- 另请参阅:
-
MM_PER_PT
public static final double MM_PER_PT- 另请参阅:
-
EMU_PER_PX
public static final int EMU_PER_PX- 另请参阅:
-
EMU_PER_DXA
public static final int EMU_PER_DXA- 另请参阅:
-
-
构造器详细资料
-
DocxUtil
public DocxUtil()
-
-
方法详细资料
-
listStyle
根据关键字查找样式列表ID- 参数:
docx- docx文件key- 关键字- 返回:
- String
-
listStyles
根据关键字查找样式列表ID- 参数:
docx- docx文件- 返回:
- String
-
merge
合并文件(只合并内容document.xml)合并到第一个文件中- 参数:
files- files
-
merge
-
copyStyle
public static void copyStyle(org.dom4j.Element src, org.dom4j.Element copy, boolean override) copy的样式复制给src- 参数:
src- srccopy- 被复制p/w或pPr/wProverride- 如果样式重复,是否覆盖原来的样式
-
copyStyle
public static void copyStyle(org.dom4j.Element src, org.dom4j.Element copy) -
prevByName
public static org.dom4j.Element prevByName(org.dom4j.Element element) 前一个节点- 参数:
element- element- 返回:
- element
-
prevByName
public static org.dom4j.Element prevByName(org.dom4j.Element parent, org.dom4j.Element element) -
nextByName
public static org.dom4j.Element nextByName(org.dom4j.Element element) -
nextByName
public static org.dom4j.Element nextByName(org.dom4j.Element parent, org.dom4j.Element element) -
top
public static org.dom4j.Element top(org.dom4j.Element element) -
prev
public static org.dom4j.Element prev(org.dom4j.Element element) 前一个节点- 参数:
element- element- 返回:
- element
-
prevName
-
last
public static org.dom4j.Element last(org.dom4j.Element element) -
lastName
-
isEmpty
public static boolean isEmpty(org.dom4j.Element element) -
hasParent
-
getParent
获取element的上一级中第一个标签名=tag的上级- 参数:
element- 当前节点tag- 上级标签名 如tbl- 返回:
- Element
-
after
public static void after(org.dom4j.Element src, org.dom4j.Element ref) src插入到ref之后- 参数:
src- srcref- ref
-
after
-
before
public static void before(org.dom4j.Element src, org.dom4j.Element ref) src插入到ref之前- 参数:
src- srcref- ref
-
index
public static int index(org.dom4j.Element element) 当前节点在上级节点的下标- 参数:
element- element- 返回:
- index index
-
splitKey
拆分关键字 拆分123${key}abc成多个w:t- 参数:
txt- txt- 返回:
- List
-
border
-
border
-
padding
-
padding
-
fontSize
-
font
-
background
-
addElement
public static org.dom4j.Element addElement(org.dom4j.Element parent, String tag, String key, String value) 添加element及属性- 参数:
parent- parenttag- element tagkey- attribute keyvalue- attribute value- 返回:
- Element
-
addAttribute
-
addElement
-
next
public static org.dom4j.Element next(org.dom4j.Element parent, org.dom4j.Element child) -
prev
public static org.dom4j.Element prev(org.dom4j.Element parent, org.dom4j.Element child) -
text
当前节点下的文本- 参数:
element- element- 返回:
- String
-
isBlock
-
betweens
-
bookmark
-
pr
-
pr
-
setOrient
-
removeAttribute
-
removeContent
public static void removeContent(org.dom4j.Element parent) -
removeElement
-
dxa
宽度计算- 参数:
src- width- 返回:
- dxa
-
widthType
-
px2dxa
public static final int px2dxa(int px) -
px2dxa
public static final int px2dxa(double px) -
pt2dxa
public static final int pt2dxa(double pt) -
dxa2pt
public static final double dxa2pt(double dxa) -
dxa2px
public static final double dxa2px(double dxa) -
px2emu
public static final int px2emu(int px) -
dxa2emu
public static final double dxa2emu(double dxa) -
emu2px
public static final double emu2px(double emu) -
pt2px
public static final double pt2px(double pt) -
in2px
public static final double in2px(double in) -
px2in
public static final double px2in(double px) -
cm2px
public static final double cm2px(double cm) -
px2cm
public static final double px2cm(double px) -
mm2px
public static final double mm2px(double mm) -
px2mm
public static final double px2mm(double px) -
pt2in
public static final double pt2in(double pt) -
pt2mm
public static final double pt2mm(double mm) -
pt2cm
public static final double pt2cm(double in) -
px2pt
public static final double px2pt(double px) -
in2pt
public static final double in2pt(double in) -
mm2pt
public static final double mm2pt(double mm) -
cm2pt
public static final double cm2pt(double cm) -
cm2dxa
public static final int cm2dxa(double cm)
-