473,796 Members | 2,704 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6474
le***********@g mail.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***********@g mail.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***********@g mail.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***********@g mail.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***********@g mail.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***********@g mail.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
2398
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 vbSettle prpFor noEnglish prpIn adjHungarian noNotation :-)" -- noPeter Jack Jensen reveals that python on mac continues as an osx option only starting with python2.4.
7
3673
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. And i have things to offer, and to request. And a lot of ideas, but who needs them.... here's an example (from type_struct.py):
34
5099
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 and rewriting it in python Would this idea make sense to do - if so what would be the benefits of doing this and in what way would this not be a good idea Cheers
10
2718
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 but I do not see much documentation on converting ptyhon types to other data types. Any Help would be appreciated.
2
4455
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 */ #include <time.h>
13
3932
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 Chinese characters, but neverthelss is unable to show them up on screen. The follow is some of the error message I received after I logged off the program: "Could not write output: <type "exceptions: UnicodeEncodeError'>, 'ascii' codec can't...
0
10467
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10244
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10021
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9061
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6802
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5454
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4130
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2931
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.