Key code
<script type="Text/javascript"Src="Http://myxdoc.sohuapps.com/xdoc.js"></script>
<script id="Myxdoc"Type="Text/xdoc"_format="PDF"style="width:100%;height:100%;">
The contents of the script are Xdoc, as shown in: http://myxdoc.sohuapps.com/xml.html
The _format property specifies the output format, which can also be flash, docx, and so on, and the attributes in the script can use Xdoc available parameters, and the Style property defines the style of the presentation result.
This way, the xdoc tag is perfectly combined with HTML, and documents such as output PDFs are identical to the output HTML. You can use JSP, PHP, ASP, Freemarker and other dynamic output documents.
<meta charset="UTF-8">
<script type="Text/javascript"Src="Http://myxdoc.sohuapps.com/xdoc.js"></script>
<body style="height:100%; margin:0; Overflow:hidden ;">
<script id="Myxdoc"Type="Text/xdoc"_format="PDF"style="width:100%;height:100%;">
<xdoc version="a.3.0">
<paper margin="0"Width=" -"height="380"/>
<body padding=" -"fillimg="# @f40">
<para align="Center">
" the"height=" the"Fillcolor=""Drawtype="Adjust"Src="http://img.ddky.com/c/product/282740/800_mid/z_1.jpg"/>
</para>
<para align="Center">
<text fontname="Mark Song"Fontsize=" -">[(Tomson) Vitamin C chewable tablets </text>
</para>
<para align="Center">
<text fontcolor="#ff0000"Fontname="Mark Song"format="C"Fontsize=" -"> the</text>
</para>
<para align="Center">
<barcode type="QRCode"Width="148"height="148"margin="8"Value="http://h.ddky.com/shangpinxiangqing.html?shopId=100012&id=282740&skuId=28274001"/>
</para>
</body>
</xdoc>
</script>
</body>
Elegant generation of PDFs in HTML