标签中加空格符
  这个就代表着空格,一个 相当于英文的一个字母的占位,四个 相当于一个汉字的占位。
空格符
<w:r><w:tab/></w:r><w:r><w:tab/></w:r><w:r><w:tab/></w:r><w:r><w:tab/></w:r><w:r><w:tab/></w:r>
添加图片
<w:r><w:rPr><w:noProof/></w:rPr>
<w:pict><w:binData w:name="wordml://02000003.jpg" xml:space="preserve">#(sign_base64)
</w:binData>
<v:shape id="_x0000_s1032" type="#_x0000_t75"
style="position:absolute;left:0;text-align:left;margin-left:79.15pt;margin-top:14.4pt;width:66.65pt;height:36.65pt;z-index:4;mso-position-horizontal-relative:text;mso-position-vertical-relative:text"><v:imagedata src="wordml://02000003.jpg" o:title="1-1P11410015C94"/></v:shape></w:pict></w:r></w:p><w:p
wsp:rsidR="00D702E8" wsp:rsidRDefault="00DA1EC3"><w:pPr><w:ind w:first-line-chars="300" w:first-line="840"/><w:rPr><w:sz w:val="28"/>
<w:sz-cs w:val="28"/></w:rPr></w:pPr>
新版的word xml添加图片后必须修改
//这里也必须修改
<pkg:part pkg:name="/word/media/image1.png" pkg:contentType="image/png" pkg:compression="store">
<pkg:binaryData>#(sign_base64)
</pkg:binaryData>
</pkg:part>
<pkg:part pkg:name="/word/media/image2.png" pkg:contentType="image/png" pkg:compression="store">
<pkg:binaryData>#(sign_base64)
</pkg:binaryData>
</pkg:part>
<pkg:part pkg:name="/word/media/image3.png" pkg:contentType="image/png" pkg:compression="store">
<pkg:binaryData>#(card_base64)
</pkg:binaryData>
</pkg:part>
//图片改base64
private String getbase64(String img_url) throws IOException {
String suffix = card_url.substring(card_url.lastIndexOf(".") + 1);
URL urls = new URL(card_url);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
Image image = Toolkit.getDefaultToolkit().getImage(urls);
BufferedImage biOut = toBufferedImage(image);
ImageIO.write(biOut, suffix, baos);
return Base64Util.encode(baos.toByteArray());
}
public static BufferedImage toBufferedImage(Image image) {
if (image instanceof BufferedImage) {
return (BufferedImage) image;
}
// This code ensures that all the pixels in the image are loaded
image = new ImageIcon(image).getImage();
BufferedImage bimage = null;
GraphicsEnvironment ge = GraphicsEnvironment
.getLocalGraphicsEnvironment();
try {
int transparency = Transparency.OPAQUE;
GraphicsDevice gs = ge.getDefaultScreenDevice();
GraphicsConfiguration gc = gs.getDefaultConfiguration();
bimage = gc.createCompatibleImage(image.getWidth(null),
image.getHeight(null), transparency);
} catch (HeadlessException e) {
// The system does not have a screen
}
if (bimage == null) {
// Create a buffered image using the default color model
int type = BufferedImage.TYPE_INT_RGB;
bimage = new BufferedImage(image.getWidth(null),
image.getHeight(null), type);
}
// Copy image to buffered image
Graphics g = bimage.createGraphics();
// Paint the image onto the buffered image
g.drawImage(image, 0, 0, null);
g.dispose();
return bimage;
}