---
title: "诗词排版"
author: "xdoc"
date: "2016-12-04T09:16:39Z"
tags: []
categories: ["Web前端"]
slug: "untitled"
draft: false
lastmod: "2016-12-04T09:16:56Z"
id: 2342714
url: "https://xdoc.iteye.com/blog/2342714"
---

```
<!DOCTYPE html>
<html>
  <head> 
    <meta charset="UTF-8">
    <script type="text/javascript" src="http://www.xdocin.com/xdoc.js"></script> 
  </head>  
  <body> 
    <input type="button" onclick="gen()" value="诗词排版"/>
    <br/>
	<script type="text/javascript">
	function gen() {
		var params = {
			"title": "静夜思",
			"author": "李白",
			"content": "床前明月光，\n疑是地上霜。\n举头望明月，\n低头思故乡。"
		};
		XDoc.run("./poem.xdoc", "png", params, "_blank");
	}
	</script>
  </body> 
</html>
```

 [http://xdocin.com/poem.pdoc?\_format=html](http://xdocin.com/poem.pdoc?_format=html)  
![](http://dl2.iteye.com/upload/attachment/0121/7181/44d7db55-9f67-37ee-8b9a-9d4130cb85b4.png)