• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

test/H08-Oct-2020-4323

xhtml2pdf/H08-Oct-2020-11,5878,477

xhtml2pdf.egg-info/H03-May-2022-220145

MANIFEST.inH A D08-Aug-201882 54

PKG-INFOH A D08-Oct-20208.9 KiB220145

README.rstH A D08-Oct-20205.9 KiB178104

setup.cfgH A D08-Oct-2020257 2317

setup.pyH A D08-Oct-20203 KiB8562

README.rst

1XHTML2PDF
2=========
3
4.. image:: https://img.shields.io/pypi/v/xhtml2pdf?label=PyPI&logo=PyPI&logoColor=white&color=blue
5    :target: https://pypi.python.org/pypi/xhtml2pdf
6    :alt: PyPI version
7
8.. image:: https://img.shields.io/pypi/pyversions/xhtml2pdf?label=Python&logo=Python&logoColor=white
9    :target: https://www.python.org/downloads
10    :alt: Python versions
11
12.. image:: https://img.shields.io/travis/xhtml2pdf/xhtml2pdf/master.svg?label=Travis%20CI&logo=Travis&logoColor=white
13    :target: https://travis-ci.org/xhtml2pdf/xhtml2pdf
14    :alt: Travis CI
15
16.. image:: https://img.shields.io/appveyor/build/LegoStormtroopr/xhtml2pdf?label=AppVeyor&logo=appveyor&logoColor=white
17    :target: https://ci.appveyor.com/project/LegoStormtroopr/xhtml2pdf/branch/master
18    :alt: AppVeyor
19
20.. image:: https://img.shields.io/coveralls/github/xhtml2pdf/xhtml2pdf?label=Coveralls&logo=Coveralls&logoColor=white
21    :target: https://coveralls.io/github/xhtml2pdf/xhtml2pdf
22    :alt: Coveralls
23
24.. image:: https://img.shields.io/readthedocs/xhtml2pdf?label=Read%20the%20Docs&logo=read%20the%20docs&logoColor=white
25   :target: http://xhtml2pdf.readthedocs.io/en/latest/?badge=latest
26   :alt: Read the Docs
27
28|
29
30The current release of xhtml2pdf is **xhtml2pdf 0.2.5**. As with all open-source software, its use in production depends on many factors, so be aware that you may find issues in some cases.
31
32**Big thanks** to everyone who has worked on this project so far and to those who help maintain it.
33
34About
35=====
36
37xhtml2pdf is a HTML to PDF converter using Python, the ReportLab Toolkit, html5lib and PyPDF2. It supports HTML5 and CSS 2.1 (and some of CSS 3). It is completely written in pure Python, so it is platform independent.
38
39The main benefit of this tool is that a user with web skills like HTML and CSS is able to generate PDF templates very quickly without learning new technologies.
40
41
42Documentation
43==============
44
45The documentation of xhtml2pdf is available at `Read the Docs <http://xhtml2pdf.readthedocs.io>`__.
46
47And we could use your help improving it! A good place to start is ``doc/source/usage.rst``.
48
49
50Installation
51============
52
53This is a typical Python library and can be installed using pip::
54
55    pip install xhtml2pdf
56
57
58Requirements
59============
60
61Python 2.7+. Only Python 3.4+ is tested and guaranteed to work.
62
63All additional requirements are listed in the ``requirements.txt`` file and are installed automatically using the ``pip install xhtml2pdf`` method.
64
65
66Alternatives
67==============================
68
69You can try `WeasyPrint <http://weasyprint.org>`__. The codebase is pretty, it has different features and it does a lot of what xhtml2pdf does.
70
71
72Call for testing
73================
74
75This project is heavily dependent on getting its test coverage up! Furthermore, parts of the codebase could do well with cleanups and refactoring.
76
77If you benefit from xhtml2pdf, perhaps look at the `test coverage <https://coveralls.io/github/xhtml2pdf/xhtml2pdf>`__ and identify parts that are yet untouched.
78
79
80Development environment
81=======================
82
83#. If you don't have it, install ``pip``, the python package installer::
84
85    sudo easy_install pip
86
87   For more information about ``pip`` refer to http://www.pip-installer.org
88
89#. We will recommend using ``virtualenv`` for development. It's great to have a separate environment for each project, keeping the dependencies for multiple projects separated::
90
91    sudo pip install virtualenv
92
93   For more information about ``virtualenv`` refer to http://www.virtualenv.org
94
95#. Create a virtualenv for the project. This can be inside the project directory, but cannot be under version control::
96
97    virtualenv --distribute xhtml2pdfenv --python=python2
98
99#. Activate your virtualenv::
100
101    source xhtml2pdfenv/bin/activate
102
103   Later to deactivate it use::
104
105    deactivate
106
107#. The next step will be to install/upgrade dependencies from the ``requirements.txt`` file::
108
109    pip install -r requirements.txt
110
111#. Run tests to check your configuration::
112
113    nosetests --with-coverage
114
115   You should have a log with the following success status::
116
117    Ran 36 tests in 0.322s
118
119    OK
120
121
122Python integration
123==================
124
125Some simple demos of how to integrate xhtml2pdf into a Python program may be found here: ``test/simple.py``
126
127
128Running tests
129=============
130
131Two different test suites are available to assert that xhtml2pdf works reliably:
132
133#. Unit tests. The unit testing framework is currently minimal, but is being
134   improved on a regular basis (contributions welcome). They should run in the
135   expected way for Python's unittest module, i.e.::
136
137        nosetests --with-coverage (or your personal favorite)
138
139#. Functional tests. Thanks to mawe42's super cool work, a full functional
140   test suite is available at ``testrender/``.
141
142
143Contact
144=======
145
146This project is community-led! Feel free to open up issues on GitHub about new ideas to improve xhtml2pdf.
147
148
149History
150=======
151
152These are the major milestones and the maintainers of the project:
153
154* 2000-2007, commercial project, spirito.de, written by Dirk Holtwich
155* 2007-2010 Dirk Holtwich (project named "Pisa", project released as GPL)
156* 2010-2012 Dirk Holtwick (project named "xhtml2pdf", changed license to Apache)
157* 2012-2015 Chris Glass (@chrisglass)
158* 2015-2016 Benjamin Bach (@benjaoming)
159* 2016-2018 Sam Spencer (@LegoStormtroopr)
160* 2018-Current Luis Zarate (@luisza)
161
162For more history, see the ``CHANGELOG.txt`` file.
163
164License
165=======
166
167Copyright 2010 Dirk Holtwick, holtwick.it
168
169Licensed under the Apache License, Version 2.0 (the "License");
170you may not use this file except in compliance with the License.
171You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
172
173Unless required by applicable law or agreed to in writing, software
174distributed under the License is distributed on an "AS IS" BASIS,
175WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
176See the License for the specific language governing permissions and
177limitations under the License.
178