小编nea*_*ltz的帖子

Python和ReportLab:PDF表格中的列宽和对齐错误

我使用Python 2.7(iOS Pythonista App)和reportlab 2.7模块来创建带有表格的PDF.一切正常.RepotLab自动格式化列的宽度.但是在两种情况下,我无法理解为什么reportlab以它的方式格式化输出以及如何获得我想要的格式.

案例1:几乎我想要的一切......

+-----+----------+---------------+----------+---------------------------------------------------------------------------------------------------------------+
| Day | Date     | Time          | Duration | Notes                                                                                                         |
+-----+----------+---------------+----------+---------------------------------------------------------------------------------------------------------------+
| Tue | 01.04.14 | 14:00 - 17:15 | 3.25     | Here are some notes.                                                                                          |
+-----+----------+---------------+----------+---------------------------------------------------------------------------------------------------------------+
| Wed | 02.04.14 | 18:00 - 20:15 | 2.25     | Sometime these notes are a little longer text so there must be a line break to let the whole note be visible! |
+-----+----------+---------------+----------+---------------------------------------------------------------------------------------------------------------+
| Thu | 02.04.14 | 14:00 - 17:15 | …
Run Code Online (Sandbox Code Playgroud)

python reportlab

4
推荐指数
1
解决办法
5989
查看次数

标签 统计

python ×1

reportlab ×1