A python library to convert RTF into PDF ?

L

leonel.gayard

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
 
T

Tom Plunket

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!

--
 
L

leonel.gayard

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
 
F

Felipe Almeida Lessa

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.
 
R

robert

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
 
L

leonel.gayard

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.
 
T

Tom Plunket

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!

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top