Elegant generation of PDFs in HTML

Source: Internet
Author: User

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&amp;id=282740&amp;skuId=28274001"/>
</para>
</body>
</xdoc>
</script>
</body>

Elegant generation of PDFs in HTML

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.