By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,100 Members | 2,495 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,100 IT Pros & Developers. It's quick & easy.

A python library to convert RTF into PDF ?

P: n/a
Hi,

Does anyone know a good python library to convert a RTF file into PDF ?

This should be done automaticaly: I have a web page that takes some
values and inserts them into a RTF template, resulting in an RTF file.
However, I cannot send the output back to the user in RTF, it must be
sent in PDF instead, so I need to convert the result.

So, what library can I use to convert from RTF to PDF ? GPL / BSD
Libraries are welcome.

Thanks
Leonel

Jan 3 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a
le***********@gmail.com wrote:
So, what library can I use to convert from RTF to PDF ? GPL / BSD
Libraries are welcome.
If you could write to LaTeX files instead, you could then just use
pdflatex that comes with all of the LaTeX distributions.
-tom!

--
Jan 3 '07 #2

P: n/a
No, this won't work.

First, pdflatex is too slow. Second, my templates are M$-Word doc
files, and they cannot be easily converted to tex. I have tried to
convert them to tex using OpenOffice, but the result is ugly as hell.

I cannot convert the doc files into PDF, because I do not have a
library that allows me to manipulate PDF files. Reportlab does *not* do
the trick, it can create new pdf files, but it cannot manipulate
existing pdf files.

So, converting the doc files to RTF, in order to manipulate them is my
best chance. Now how can I convert them to PDF ?

[]'s
Leonel
Tom Plunket wrote:
le***********@gmail.com wrote:
So, what library can I use to convert from RTF to PDF ? GPL / BSD
Libraries are welcome.

If you could write to LaTeX files instead, you could then just use
pdflatex that comes with all of the LaTeX distributions.
-tom!

--
Jan 3 '07 #3

P: n/a
On 3 Jan 2007 10:52:02 -0800, le***********@gmail.com
<le***********@gmail.comwrote:
I have tried to
convert them to tex using OpenOffice, but the result is ugly as hell.
Why not use OO.org to convert DOC to PDF? It does so natively, IIRC.

--
Felipe.
Jan 3 '07 #4

P: n/a
le***********@gmail.com wrote:
Hi,

Does anyone know a good python library to convert a RTF file into PDF ?

This should be done automaticaly: I have a web page that takes some
values and inserts them into a RTF template, resulting in an RTF file.
However, I cannot send the output back to the user in RTF, it must be
sent in PDF instead, so I need to convert the result.

So, what library can I use to convert from RTF to PDF ? GPL / BSD
Libraries are welcome.
Don't know a mere self-contained job.

But probably then you are on a Windows - print the RTF through Word (win32com/ctypes) or through a RichEdit control into a .ps then convert via ghostscript/ps2pdf into a pdf. (gs obviously doesn't know RTF by default or at all...)
Robert
Jan 3 '07 #5

P: n/a
Why not use OO.org to convert DOC to PDF? It does so natively, IIRC.

I can't insert variables if the template is a DOC file. This is why we
are using RTF.
Felipe Almeida Lessa wrote:
On 3 Jan 2007 10:52:02 -0800, le***********@gmail.com
<le***********@gmail.comwrote:
I have tried to
convert them to tex using OpenOffice, but the result is ugly as hell.

Why not use OO.org to convert DOC to PDF? It does so natively, IIRC.

--
Felipe.
Jan 4 '07 #6

P: n/a
le***********@gmail.com wrote:
First, pdflatex is too slow. Second, my templates are M$-Word doc
files, and they cannot be easily converted to tex. I have tried to
convert them to tex using OpenOffice, but the result is ugly as hell.
Ok, have you tried using the PDF printers (I've used PDFfactory before,
but there are a number of free ones on SourceForge that may be worth a
shot), and just using MSWord via COM to print to that printer?

(This line of answers merely because nobody seems to know of a
directly-Python solution.)
-tom!

--
Jan 5 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.