473,624 Members | 2,240 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

help developing an editor to view openoffice files.

hello,
right now I am involved on doing a very important accessibility work.
as many people may or may not know that I am a visually handicap
person and work a lot on accessibility. the main issue at hand is to
create an accessible editor for open office.
there are a lot of things remaining on that front.
so right now I am trying to find out a temporary work around by
creating a simple accessible editor (with wxpython) for viewing and
editing open office files.
I know there must be python libraries that can open/ save .odt files
because it is an open standard any ways.
but I am trying to work out a kind of a program where those files can
also be displayed in a text area with all the formatting.
probably one way of doing it is to use some thing like a rich text
editor and allow the file to be converted to rtf from odt for viewing
and back again to odt when the user wishes to save it.
another way I find is to actually find out if there is a odt text box
that can display these files as they are.
viewing the contents of the files in an editable way is most important.
any suggestions?
regards.
Krishnakant.
Mar 13 '07 #1
4 1889
krishnakant Mane wrote:
hello,
right now I am involved on doing a very important accessibility work.
as many people may or may not know that I am a visually handicap
person and work a lot on accessibility. the main issue at hand is to
create an accessible editor for open office.
there are a lot of things remaining on that front.
so right now I am trying to find out a temporary work around by
creating a simple accessible editor (with wxpython) for viewing and
editing open office files.
I know there must be python libraries that can open/ save .odt files
because it is an open standard any ways.
but I am trying to work out a kind of a program where those files can
also be displayed in a text area with all the formatting.
probably one way of doing it is to use some thing like a rich text
editor and allow the file to be converted to rtf from odt for viewing
and back again to odt when the user wishes to save it.
another way I find is to actually find out if there is a odt text box
that can display these files as they are.
viewing the contents of the files in an editable way is most important.
any suggestions?
regards.
Krishnakant.
There is an O'Reilly Book about hacking the Open Office Format, and
it is available free on line in both html and pdf.

Open office files are a variation on 'Zipped' archives and
many unzip tools can be used to open them, apart from ones
that insist on a .zip extension. These include python tools.

The one 'case study' in the book that uses python is actually for
a spreadsheet, but that makes little difference to the
'unzipping' part. You can find it at:

http://books.evc-cit.info/odbook/ch0...dsheet-section

Once you have the raw XML you should be able to convert it to any one of
many more accessible XML formats, for screen readers, brail
printers and so on. I don't know much about them, but hopefully you
do!

Don't re-invent the wheel! You will find quite a few ways on the Open
Office Wiki for converting the format to other things. You can also
daisy-tail the XSLT files; for example use one to convert to xhtml and
a second that converts xhtml to text.

Example (Display write files in the 'Firefox' browser).
http://wiki.services.openoffice.org/...ader_extension
Don't forget that Open Office already has PDF export facilities, and
Acrobat reader already has some accessibility ability for simple
documents (i.e single column, 'start at the beginning, keep going until
you get to the end, and then stop'). For adding structure to other PDF
files you would need Acrobat Professional or software that can export
'tagged' PDFs.

The case-study code is:

import xml.dom
import xml.dom.ext
import xml.dom.minidom
import xml.parsers.exp at
import sys
import od_number
from zipfile import *
from StringIO import *

if (len(sys.argv) == 4):

# Open an existing OpenDocument file
#
inFile = ZipFile( sys.argv[1] )

# ...and a brand new output file
#
outFile = ZipFile( sys.argv[2], "w", ZIP_DEFLATED );

getParameters( sys.argv[3] )

#
# modify all appropriate currency styles
#
fixCurrency( "styles.xml " )
fixCurrency( "content.xm l" )

#
# copy the manifest
#
copyManifest( )

inFile.close
outFile.close
else:
print "Usage: " + sys.argv[0] + " inputfile outputfile parameterfile"
Mar 13 '07 #2
Ken Starks wrote:
krishnakant Mane wrote:
>hello,
right now I am involved on doing a very important accessibility work.
as many people may or may not know that I am a visually handicap
person and work a lot on accessibility. the main issue at hand is to
create an accessible editor for open office.
there are a lot of things remaining on that front.
so right now I am trying to find out a temporary work around by
creating a simple accessible editor (with wxpython) for viewing and
editing open office files.
I know there must be python libraries that can open/ save .odt files
because it is an open standard any ways.
but I am trying to work out a kind of a program where those files can
also be displayed in a text area with all the formatting.
probably one way of doing it is to use some thing like a rich text
editor and allow the file to be converted to rtf from odt for viewing
and back again to odt when the user wishes to save it.
another way I find is to actually find out if there is a odt text box
that can display these files as they are.
viewing the contents of the files in an editable way is most important.
any suggestions?
regards.
Krishnakant.

There is an O'Reilly Book about hacking the Open Office Format, and
it is available free on line in both html and pdf.
More expensive but well reviewed is:

http://www.amazon.com/gp/product/cus...283155&s=books

Colin W.
>
Open office files are a variation on 'Zipped' archives and
many unzip tools can be used to open them, apart from ones
that insist on a .zip extension. These include python tools.

The one 'case study' in the book that uses python is actually for
a spreadsheet, but that makes little difference to the
'unzipping' part. You can find it at:

http://books.evc-cit.info/odbook/ch0...dsheet-section

Once you have the raw XML you should be able to convert it to any one of
many more accessible XML formats, for screen readers, brail
printers and so on. I don't know much about them, but hopefully you
do!

Don't re-invent the wheel! You will find quite a few ways on the Open
Office Wiki for converting the format to other things. You can also
daisy-tail the XSLT files; for example use one to convert to xhtml and
a second that converts xhtml to text.

Example (Display write files in the 'Firefox' browser).
http://wiki.services.openoffice.org/...ader_extension
Don't forget that Open Office already has PDF export facilities, and
Acrobat reader already has some accessibility ability for simple
documents (i.e single column, 'start at the beginning, keep going until
you get to the end, and then stop'). For adding structure to other PDF
files you would need Acrobat Professional or software that can export
'tagged' PDFs.

The case-study code is:

import xml.dom
import xml.dom.ext
import xml.dom.minidom
import xml.parsers.exp at
import sys
import od_number
from zipfile import *
from StringIO import *

if (len(sys.argv) == 4):

# Open an existing OpenDocument file
#
inFile = ZipFile( sys.argv[1] )

# ...and a brand new output file
#
outFile = ZipFile( sys.argv[2], "w", ZIP_DEFLATED );

getParameters( sys.argv[3] )

#
# modify all appropriate currency styles
#
fixCurrency( "styles.xml " )
fixCurrency( "content.xm l" )

#
# copy the manifest
#
copyManifest( )

inFile.close
outFile.close
else:
print "Usage: " + sys.argv[0] + " inputfile outputfile parameterfile"
Mar 13 '07 #3
hello,
well what I exactly need to do is firstly have a way to read .odt and
..ods files.
I have a lot of information in open office format which I need to access.
The most important thing is that I completely want to avoid the use of
microsoft office.
so I need to firstly get access to open office documents through a
python module that can read and parse those documents and may be
convert it to html and display in some kind of an html/ text area may
be wxpython can help?
secondly I want to edit those documents may be in html format and then
when I say sayve it should save the changes back to .odt with the
formatting information.
can this be made possible?
thanks and regards,
Krishnakant.
Mar 14 '07 #4
On 14/03/07, Paul Hummer <pa**@eventuall yanyway.comwrot e:
I actually just read this in the O'Reilly book "Python Cookbook," so I
know this answer off the top of my head. OpenOffice files are merely
zip files with well documented XML inside. Use the builtin zip module
to open them, and then it's just XML parsing. As far as the editor,
you'll have to familiarize yourself with the XML data from the
documentation, and it sounds like that's quite a project.
it is indeed a huge project but I need to get started.
I know that it is xml inside a zipped archive. but reading the
documents is one thing and rendering them is another.
just in case we can convert it to html and then render it in some kind
of a html browser or html text area and then when user makes changes
to the document, we can save it back to odt. but for that we need
both way conversion.

Just out of curiosity, why not just download OpenOffice?
I wished I could use it out of the box.
but the problem is that open office does not provide any accessibility
on windows and on linux the work is going on.
regards.
Krishnakant.
Mar 14 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3549
by: fabien | last post by:
Hi, I am writing a POV-RAY editor with Python using either QT or GTK as GUI 'wrapper'. ( I am still trying both ) * * * * PYGTK * * * * I have downloaded PygtkScintilla-1.99.5. There is a lexPOV.cxx file in the package, but I can not find any POV keywords in any file ( there are about 150 POV keywords). Did i miss it, and if not, how do I create one and include it for the library building ?
3
1741
by: bugbear | last post by:
The product my company is developing uses XML files for configuration (wow - bold decision), and we have full DTD's for each. The style of the XML is similar to that used by Ant (the popular Java "make"-a-like) in that there is virtually no marked up "content"; the elements and (importantly) their attributes carry the whole weight of the information.
0
1972
by: Jean-Marie Gouarné | last post by:
The new OpenOffice::OODoc distribution, V 1.203, is available from CPAN today. It's an Expat-based Perl extension allowing direct read/write access to OpenOffice.org (XML) documents. It provides an object representation of the OOo documents, with a lot of methods to get, create, update or delete any content or presentation element, and attempts to hide the most part of the complex XPath navigation. This toobox is an XML API that deal...
16
2503
by: Andy_Khosravi | last post by:
I'm in a bit of a pickle. My employer, a health insurance firm, had me design a small database to track benefit issues. The intended users were technical specialists and some managers (about 90 people, no more than 10 concurrent users at any one time) all of which had Access 97 loaded on their machines. Everything was going smoothly, and I delivered them their VBA application that does everything they initially wanted it to. However,...
13
1337
by: DavidS | last post by:
I have HTML web page with <asp:Image id=img_L runat=server ImageAlign=Top Visible=True Width=y Height=x></asp:Image>. For some images, less than 128K I can view image. Other image files > 128K, image is not viewable - comes up with X in picture box. Is there size restriction. How can I remove this - or how can I show images > 128K in web page. NOTE: x & y in asp:Image spec are distinct values - say 128 x 128 or 64 x 64 image sizes
0
2074
by: dtsearch | last post by:
New release expands-through a .NET Spider API, to Linux, and to OpenOffice-dtSearch's ability to index over a terabyte of text in a single index, with indexed search time typically less than a second BETHESDA, MD (January 10, 2006) dtSearch Corp., a leading supplier of enterprise and developer text retrieval software, announces Version 7.2 of its product line for instantly searching terabytes of documents across a desktop, network,...
7
2245
by: PaoloB | last post by:
Hi everyone, during our development, we need to write some unit tests that interact with OpenOffice through pyUno. Is there anyone who has got any experience on it? As OpenOffice is quite a large beast, and interaction is rather complex, I would like to know if there is someone who is willing to share experience (and, possibly, code).
1
1311
by: apondu | last post by:
Hi Friends... I have a simple query on building the Web Setup project. When i build my setup, i see that the code behind the .aspx pages (.cs code pages) are also included. And when i deploy the project i can see that even those code files are also deployed on the machine and the code with in those .cs files can be seen ( read-only format). But i want the code to be hidden, either those code files should not be deployed ot they should...
1
1736
by: =?Utf-8?B?d2lsbG5wb2s=?= | last post by:
Hello everyone. I have a PowerPoint Presentation that is 218 slides that includes animated gifs and sounds and everything. Currently they are online where the user will have to download the files to thier computer to view the presentation. I need a way to maybe embed the presentation into a webpage so that it can just be viewed online without having to download all the files to the local PC. I have already tried countless conversion...
0
8242
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8629
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...
1
8341
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7170
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...
1
6112
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4084
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
4183
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2611
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
2
1488
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.