473,395 Members | 1,527 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

A python library to convert RTF into PDF ?

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
6 6419
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Emile van Sebille | last post by:
QOTW: "If we get 2.3.3c1 out in early December, we could release 2.3.3 final before the end of the year, and start 2004 with a 100% bug-free codebase <wink>." -- Tim Peters "cjOr proWe vbCould...
7
by: svilen | last post by:
hello again. i'm now into using python instead of another language(s) for describing structures of data, including names, structure, type-checks, conversions, value-validations, metadata etc....
34
by: Maboroshi | last post by:
Hello My question has to do with python and linux - I was interested in finding out what it would take to reimplement the Linux Kernel in python basically just taking the source code from linux...
10
by: DaBeef | last post by:
Hello, I am reading in a socket message from a server and am only receiving this '....'. Now obviously it is in the wrong format. How would I convert these bys in Python, I have looked everywhere...
2
by: ajikoe | last post by:
Hi, I tried to follow the example in swig homepage. I found error which I don't understand. I use bcc32, I already include directory where my python.h exist in bcc32.cfg. /* File : example.c...
13
by: Liang Chen | last post by:
Hope you all had a nice weekend. I have a question that I hope someone can help me out. I want to run a Python program that uses Tkinter for the user interface (GUI). The program allows me to type...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.