Hello Hugues,
Thursday, May 26, 2005, 11:59:26 AM, you wrote:
Jean-Michel Fauth a écrit : Hughes Jean-Baptiste wrote:
I want to load a postscript file, modify (file.replace('a', 'b')),
preview and print in a wxPython application.
Under Linux, it will be easy (many tools for this problem), but under MSW
?
Is it possible to transfer a postscript file to wx.printout or something
like that ?
I think it is doable. Well, your question is a little bit confusing.
If you want to display and print postscript files on Windows,
no problem, there are tools for this (ghostscript, ...).
It is not a wxPython problem.
If you want to display and print a postscript file within a wxPython
application, you should create a pdf file from your postscript file and
then display the pdf file in the wxPython application.
What sounds strange to me, is the postscript file modification.
Why do you want to modify it?
Jean-Michel Fauth, Switzerland.
Hi Jean-Michel,
Thanks for your interest in my problem
Sorry a new time for my bad English, I imagine English people readingthis mail >:o
I am going to try to explain my goal :
I've already done programs in other context (not wxPython), witch dothe next :
Draw a complicated form (Logos, many lines, ...) with the
toolyou want (Ex : MS Word, OO Writer,...) Print it in a file
with a postscript driver (Under Linux, it'snatural and under MSW
there is a Acrobat postscript driver) Under Linux, I use xfig
(www.xfig.org) or tgiff (xfig is betterand completely free) to
add fields over the form Export it in a new postscript file
where we can see at the end ofthe file in postcript language, but
easy to read, the added fields Now we can easily replace in the
new postscript file "FIELD1" by"Name of the client" and send it
to the laser printer or use "ps2pdf"under linux to make a pdf
file and send it by mail
The interest of this solution is :
The final user can easily modifiy the form without me
(Modifylogos, add comments, advertises) In the program it's easy
to do the replacements of fields the design of the form is
disconnected from the program
Now, in a new application of pay, in wxPython (very good
tool), I wantto do something like that. But, there is new
constraints :
It's possible that in the local network, there is no
linux server(horrible assumption, isn't it ... ) The
standard lists are previewed by wx.PrintPreview (this workfine)
and it will be better if all are previewed by the same
tool.Moreover, the new versions of Acrobat Reader is too much
longer to start
Client stations can be MSW XP, MSW 98SE or Linux Mandrake ouMandriva
The problem is :
Idon't know how to give a postscript file to
wx.PrintPreview ? How transforming a postscript file to
something good forwx.PrintPreview ? Another idea ?
In this moment, I'm trying a mixed with wx.Printout
andwx.html.HtmlDCRenderer and if I don't find anything else, I'll
keep it.
But it's more difficult to draw a complicated form in html
language forme and for a final user (Even the use of a simple
tool as MozillaComposer).
Friendly.
You can alway use ghostscript ro rip the ps file to a bmp format and
then load the bmp into python.
You can also use reportlab to so some of the tricks- please note that
for rippingyu need to get the commercial version.
ps to pdf conversion is usually not that big a problrm, except you go
into prepress, but from what you described this is not the case.
There are also some little cheap tools out there you can trigger (cmd
line). I know of ps2all... just google around a little.
CHeers,
···
--
Best regards,
the_shelter mailto:pdftex@the-shelter.de