Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #45297 > unrolled thread
| Started by | Christian Jurk <commx@commx.ws> |
|---|---|
| First post | 2013-05-14 08:05 -0700 |
| Last post | 2013-05-15 09:48 +0300 |
| Articles | 5 — 5 participants |
Back to article view | Back to comp.lang.python
PDF generator decision Christian Jurk <commx@commx.ws> - 2013-05-14 08:05 -0700
Re: PDF generator decision Frank Miles <fpm@u.washington.edu> - 2013-05-14 15:21 +0000
Re: PDF generator decision jmfauth <wxjmfauth@gmail.com> - 2013-05-14 10:36 -0700
Re: PDF generator decision dieter <dieter@handshake.de> - 2013-05-15 08:22 +0200
RE: PDF generator decision Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-05-15 09:48 +0300
| From | Christian Jurk <commx@commx.ws> |
|---|---|
| Date | 2013-05-14 08:05 -0700 |
| Subject | PDF generator decision |
| Message-ID | <3f4500ad-784a-401d-a089-e2b7081821e9@googlegroups.com> |
Hi folks, This questions may be asked several times already, but the development of relevant software continues day-for-day. For some time now I've been using xhtml2pdf [1] to generate PDF documents from HTML templates (which are rendered through my Django-based web application. This have been working for some time now but I'm constantly adding new templates and they are not looking like I want it (sometimes bold text is bold, sometimes not, layout issues, etc). I'd like to use something else than xhtml2pdf. So far I'd like to ask which is the (probably) best way to create PDFs in Python (3)? It is important for me that I am able to specify not only background graphics, paragaphs, tables and so on but also to specify page headers/footers. The reason is that I have a bunch of documents to be generated (including Invoice templates, Quotes - stuff like that). Any advice is welcome. Thanks. [1] https://github.com/chrisglass/xhtml2pdf
[toc] | [next] | [standalone]
| From | Frank Miles <fpm@u.washington.edu> |
|---|---|
| Date | 2013-05-14 15:21 +0000 |
| Message-ID | <kmtkq0$sdo$1@dont-email.me> |
| In reply to | #45297 |
On Tue, 14 May 2013 08:05:53 -0700, Christian Jurk wrote:
> Hi folks,
>
> This questions may be asked several times already, but the development
> of relevant software continues day-for-day. For some time now I've been
> using xhtml2pdf [1] to generate PDF documents from HTML templates (which
> are rendered through my Django-based web application. This have been
> working for some time now but I'm constantly adding new templates and
> they are not looking like I want it (sometimes bold text is bold,
> sometimes not, layout issues, etc). I'd like to use something else than
> xhtml2pdf.
>
> So far I'd like to ask which is the (probably) best way to create PDFs
> in Python (3)? It is important for me that I am able to specify not only
> background graphics, paragaphs, tables and so on but also to specify
> page headers/footers. The reason is that I have a bunch of documents to
> be generated (including Invoice templates, Quotes - stuff like that).
>
> Any advice is welcome. Thanks.
>
> [1] https://github.com/chrisglass/xhtml2pdf
Reportlab works well in Python 2.x. Their _next_ version is supposed to
work with Python3... {yes, not much help there}
[toc] | [prev] | [next] | [standalone]
| From | jmfauth <wxjmfauth@gmail.com> |
|---|---|
| Date | 2013-05-14 10:36 -0700 |
| Message-ID | <39026458-6d08-49ec-8e35-802e17dae7dd@o10g2000vbp.googlegroups.com> |
| In reply to | #45297 |
On 14 mai, 17:05, Christian Jurk <co...@commx.ws> wrote: > Hi folks, > > This questions may be asked several times already, but the development of relevant software continues day-for-day. For some time now I've been using xhtml2pdf [1] to generate PDF documents from HTML templates (which are rendered through my Django-based web application. This have been working for some time now but I'm constantly adding new templates and they are not looking like I want it (sometimes bold text is bold, sometimes not, layout issues, etc). I'd like to use something else than xhtml2pdf. > > So far I'd like to ask which is the (probably) best way to create PDFs in Python (3)? It is important for me that I am able to specify not only background graphics, paragaphs, tables and so on but also to specify page headers/footers. The reason is that I have a bunch of documents to be generated (including Invoice templates, Quotes - stuff like that). > > Any advice is welcome. Thanks. > > [1]https://github.com/chrisglass/xhtml2pdf ----- 1) Use Python to collect your data (db, pictures, texts, ...) and/or to create the material (text, graphics, ...) that will be the contents (source) of your your pdf's. 2) Put this source in .tex file (a plain text file). 3) Let it compile with a TeX engine. - I can not figure out something more versatile and basically simple (writing a text file). - Do not forget you are the only one who knows the content and the layout of your document(s). jmf
[toc] | [prev] | [next] | [standalone]
| From | dieter <dieter@handshake.de> |
|---|---|
| Date | 2013-05-15 08:22 +0200 |
| Message-ID | <mailman.1689.1368598960.3114.python-list@python.org> |
| In reply to | #45297 |
Christian Jurk <commx@commx.ws> writes: > ... > So far I'd like to ask which is the (probably) best way to create PDFs in Python (3)? It is important for me that I am able to specify not only background graphics, paragaphs, tables and so on but also to specify page headers/footers. The reason is that I have a bunch of documents to be generated (including Invoice templates, Quotes - stuff like that). High quality layouts, especially those containing (potentially complex tables), are very difficult to generate automatically. I do not suppose that you will find a generic solution - one applicable to a wide range of document classes and garanteeing high quality layout for almost all of its document instances.
[toc] | [prev] | [next] | [standalone]
| From | Carlos Nepomuceno <carlosnepomuceno@outlook.com> |
|---|---|
| Date | 2013-05-15 09:48 +0300 |
| Message-ID | <mailman.1690.1368600582.3114.python-list@python.org> |
| In reply to | #45297 |
Christian, have you tried pod[1]? You can use create templates in OpenDocument format and then create the PDFs just passing the arguments, like:
args = {'name':'John', 'email':'john@example.com'}
renderer = Renderer('template.odt', args, 'result.odt')renderer.run()
[1] http://appyframework.org/pod.html
----------------------------------------
> To: python-list@python.org
> From: dieter@handshake.de
> Subject: Re: PDF generator decision
> Date: Wed, 15 May 2013 08:22:25 +0200
>
> Christian Jurk <commx@commx.ws> writes:
>
>> ...
>> So far I'd like to ask which is the (probably) best way to create PDFs in Python (3)? It is important for me that I am able to specify not only background graphics, paragaphs, tables and so on but also to specify page headers/footers. The reason is that I have a bunch of documents to be generated (including Invoice templates, Quotes - stuff like that).
>
> High quality layouts, especially those containing (potentially complex
> tables), are very difficult to generate automatically.
>
> I do not suppose that you will find a generic solution - one applicable
> to a wide range of document classes and garanteeing high quality
> layout for almost all of its document instances.
>
> --
> http://mail.python.org/mailman/listinfo/python-list
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web