这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录 前一修订版 | 上一修订版 两侧同时换到之后的修订记录 | ||
python-files:pdf-calendar [2017/04/01 06:03] admin [Python 源代码] |
python-files:pdf-calendar [2017/04/01 06:06] admin |
||
---|---|---|---|
行 5: | 行 5: | ||
* calendar (python self contained) | * calendar (python self contained) | ||
* reportlab | * reportlab | ||
+ | |||
+ | ===== 功能修改 ===== | ||
+ | 做了下面的一些修改。 | ||
+ | |||
+ | ==== 字体 ==== | ||
在源代码里面增加了字体部分: | 在源代码里面增加了字体部分: | ||
- | <code> | + | <code python> |
- | canvas.setFont("Times-Roman", 20) | + | canvas.setFont("Times-Roman", 20) |
</code> | </code> | ||
- | ===== Python 源代码 ===== | + | ==== 增加日历的星期名称 ==== |
<code python> | <code python> | ||
- | #!/usr/bin/env python | + | weekheader = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ]; |
- | """Create a PDF calendar. | + | </code> |
- | This script requires Python and Reportlab | + | 日历表格中行数增加一行,表格的线也都不气了。 |
- | ( http://reportlab.org/rl_toolkit.html ). Tested only with Python 2.4 and | + | |
- | Reportlab 1.2. | + | |
- | See bottom of file for an example of usage. No command-line interface has been | + | ===== Python 源代码 ===== |
- | added, but it would be trivial to do so. Furthermore, this script is pretty | + | |
- | hacky, and could use some refactoring, but it works for what it's intended | + | |
- | to do. | + | |
- | Created by Bill Mill on 11/16/05, this script is in the public domain. There | ||
- | are no express warranties, so if you mess stuff up with this script, it's not | ||
- | my fault. | ||
- | If you have questions or comments or bugfixes or flames, please drop me a line | + | |
- | at bill.mill@gmail.com . | + | <code python> |
- | """ | + | |
from reportlab.lib import pagesizes | from reportlab.lib import pagesizes | ||
from reportlab.pdfgen.canvas import Canvas | from reportlab.pdfgen.canvas import Canvas |