After I converted MS Word to HTML (and fed it to the application..) the next stage was to convert MS PowerPoint to HTML.
I thought it would be rather straight forward, given the success I experienced with openoffice headless api converting Word to HTML. It wasn't.
openoffice converts ppt to html (filter "impress_html_Export"), that's right. The output is a set of files, in which each ppt slide is converted to image (screenshot) and HTML. While the screenshots are good, the HTML is not satisfactory. Embedded images in the ppt doesn't appear in the converted HTML, and the same happened for tables. In addition, using the "2 column layout" produced HTML with only the left-column text, leaving the right-column text out. Same happened for any content added to a blank layout template (e.g. text boxes). In addition, numbered list (ol) where converted to bullets (ul).
Needless to say this solution is out of the question.
So here I was, looking for a way to convert ppt to html, using Java or (preferably) Python.
Looking for a Python module to do the job I found win32com, which may be good but not relevant for me since our servers don't run Windows. Although win32com CAN run on debian I preferred working with software that is not Windows dependant.
AND THEN... I found odfpy.
It's a GPL software defining itself as "Python API and tools to manipulate OpenDocument files".
Since openoffice document is basically an archive file, this module reads and writes the archive structure, allowing for easy manipulation of all kinds of openoffice formats.
In addition, it has some built-in scripts for common tasks, e.g. odf2xhtml(which I'm using), odfoutline, csv2odfand more.
SO, I'm converting the ppt to odp using openoffice headless api, and then convert the odp to HTML using odfpy.
And it works !
Thoughts about Web Development in the post 2.0 era. Javascript, ajax, JSON, libraries (dojo, jQuery, YUI..), Python, usability, performance, good practices, tips and tricks, and other stuff I'd like to throw in..
Monday, February 01, 2010
Sunday, January 03, 2010
Explore registry of dead pc
My PC is dead.
Well, I have a new one now :-)
As it was a Windows machine, some valuable data was stored in the registry but since the pc refused to launch again (yes, even with Ubuntu 9.0 on-the-fly-disk..) I thought I've lost it.
Searching the Internet I found this simple yet useful Windows Registry File Viewer. Simply download the zip file and run the .exe file.
Now I took the hard disk from my late pc, connected it to my new pc, and browsed to the registry file:
C:\Documents and Settings\username\ntuser.dat
A really important feature of this registry viewer is that it's also a registry exporter. Select the registry node you'd like to export, click "file" and then "export to REGEDIT4 format" and you're good.
In order to import this registry file, just double click it and it's values are added to your current pc registry file.
Original FAQ page.
Well, I have a new one now :-)
As it was a Windows machine, some valuable data was stored in the registry but since the pc refused to launch again (yes, even with Ubuntu 9.0 on-the-fly-disk..) I thought I've lost it.
Searching the Internet I found this simple yet useful Windows Registry File Viewer. Simply download the zip file and run the .exe file.
Now I took the hard disk from my late pc, connected it to my new pc, and browsed to the registry file:
C:\Documents and Settings\
A really important feature of this registry viewer is that it's also a registry exporter. Select the registry node you'd like to export, click "file" and then "export to REGEDIT4 format" and you're good.
In order to import this registry file, just double click it and it's values are added to your current pc registry file.
Original FAQ page.
Wednesday, December 02, 2009
openoffice Word to HTML conversion failed, ErrorCodeIOException - ErrCode = 1287
I'm converting Word documents to html using openoffice 3.1 headless version with uno protocol (python).
Reading the Word document with loadComponentFromURL was successful, but saving it as html using storeToURL threw com.sun.star.task.ErrorCodeIOException with ErrCode = 1287.
Interesting thing was the conversion worked great when I ran the code locally on the production server (debian 64), using the python's main function (if __name__ == "__main__"), but failed when I ran it from a remote machine, using http post.
I couldn't find this error code on the internet, so now that I've found the solution I'm posting it.
The issue was improper permissions for the soffice process to write the file in the target directory.
The soffice process ran under user A, and the python code ran under user B. The target directory was created in the python code, user B, so the soffice couldn't write in it.
When I ran the code locally, I logged in with user A, and that's why it worked. Had I logged in with user B I would have seen the same error.
Solution was to add users A and B to the same user group on the debian machine.
QED.
Reading the Word document with loadComponentFromURL was successful, but saving it as html using storeToURL threw com.sun.star.task.ErrorCodeIOException with ErrCode = 1287.
Interesting thing was the conversion worked great when I ran the code locally on the production server (debian 64), using the python's main function (if __name__ == "__main__"), but failed when I ran it from a remote machine, using http post.
I couldn't find this error code on the internet, so now that I've found the solution I'm posting it.
The issue was improper permissions for the soffice process to write the file in the target directory.
The soffice process ran under user A, and the python code ran under user B. The target directory was created in the python code, user B, so the soffice couldn't write in it.
When I ran the code locally, I logged in with user A, and that's why it worked. Had I logged in with user B I would have seen the same error.
Solution was to add users A and B to the same user group on the debian machine.
QED.
Sunday, November 15, 2009
tidy crashed on Debian 64bit
I'm was working on a python project that invoked a tidy process. We were using the tidy python wrapper utidylib for that, with this code:
import tidy
tidy_obj = tidy.parseString(html, {})
tidy_outstream = StringIO.StringIO()
tidy_obj.write(tidy_outstream)
tidy_html = tidy_outstream.getvalue()
And it worked fine. Almost.
When invoked it more frequently, i.e. every few seconds, it sometimes succeeded and sometimes crashed, FOR THE SAME HTML INPUT.
Searching the Internet I found that there is a known issue of tidy crashes on Debian 64 bit machines. Too bad.
Looking for an alternate tool to do the same trick I found another python wrapper for tidy that pretends to solve this issue: pytidylib. And the syntax is simpler:
import tidylib
tidy_html, errs = tidylib.tidy_document(html, {})
And guess what ? tidy process no longer crashes !
And while you are reading this, you may find this list of tidy options useful.
Enjoy tidying :-)
Thursday, November 05, 2009
Free Vulnerabilities Detector Tool - Secunia Personal Software Inspector (PSI)
I found this free software that scans your pc and detects software vulnerabilities and code flaws, alerts for installed programs that expose you to security threats and lists the latest security updates and patches you need to install. It also gives you the link to the relevant upgrade.
I scanned my pc and it found some programs needed an update such as: old version of firefox I had installed aside to the latest version I have, ancient version of Adobe Reader, stale JRE, vulnerable Windows Media Player (6.x ...), .NET framework needed to be patched and some other flaws.
After I found some trojan horses on my machine last week, this is a tool I recommend wholeheartedly.
Secunia Personal Software Inspector (PSI), download here:
http://secunia.com/vulnerability_scanning/personal/
I scanned my pc and it found some programs needed an update such as: old version of firefox I had installed aside to the latest version I have, ancient version of Adobe Reader, stale JRE, vulnerable Windows Media Player (6.x ...), .NET framework needed to be patched and some other flaws.
After I found some trojan horses on my machine last week, this is a tool I recommend wholeheartedly.
Secunia Personal Software Inspector (PSI), download here:
http://secunia.com/vulnerability_scanning/personal/
Wednesday, September 23, 2009
Dojo 1.0 and Beyond
Here's a presentation I gave last year about the Dojo library.
The presentation will teach you:
1. What is Dojo.
2. Dojo design goals.
3. Dojo concerns (widgets, packaging, data access, DOM scripting and performance).
4. Difference between Dojo Core, Dojo Dijit and DojoX and what's inside each package.
Presentation URL:
What is Dojo 1.0 and Beyond
For more about Dojo, visit dojotoolkit .
The presentation will teach you:
1. What is Dojo.
2. Dojo design goals.
3. Dojo concerns (widgets, packaging, data access, DOM scripting and performance).
4. Difference between Dojo Core, Dojo Dijit and DojoX and what's inside each package.
Presentation URL:
What is Dojo 1.0 and Beyond
For more about Dojo, visit dojotoolkit .
Here I go again...
It's been a while since I updated this blog... sorry :-)
SO (crossing my fingers),
I'm back in town, and plan to update this blog regularly.
I'll start with posting some presentations I gave at work (sharedbook dot com).
Stay tuned !
SO (crossing my fingers),
I'm back in town, and plan to update this blog regularly.
I'll start with posting some presentations I gave at work (sharedbook dot com).
Stay tuned !
Thursday, November 09, 2006
SharedBook "mashup"
We all know that nowadays "mashups" is the hottest word around the web.
You can mashup your video from YouTube in your home page, you can mashup Google maps (which is considered the "killer app" for mashup) and many more.
So, I was thinking, why not "mashup" my SharedBook's BabyBook in my blog ?
Well, why not indeed?
We created the SharedBook Mashup !
Now you can create your SharedBook, and mashup a flash widget of it in your blog or site. Isn't that great ? :-)
You can mashup your video from YouTube in your home page, you can mashup Google maps (which is considered the "killer app" for mashup) and many more.
So, I was thinking, why not "mashup" my SharedBook's BabyBook in my blog ?
Well, why not indeed?
We created the SharedBook Mashup !
Now you can create your SharedBook, and mashup a flash widget of it in your blog or site. Isn't that great ? :-)
Photo with Greg Murray
Greg (on the left) presented me the jMaki library, which turned out to be very interesting.
I also attended Greg's "Ajax and Java" session which was also very interesting.
Thanks Greg !I also attended Greg's "Ajax and Java" session which was also very interesting.
The Ajax Experience Conference
Lately I attended the Ajax Experience Conference which took place on October 23-25 2006, at Boston.
The convention was very educative and professionally organized.
I've started today a series of lectures at the office to pass the knowledge to my colleagues.
Today I gave an introduction lecture, and I plan to lecture on the following:
The convention was very educative and professionally organized.
I've started today a series of lectures at the office to pass the knowledge to my colleagues.
Today I gave an introduction lecture, and I plan to lecture on the following:
- JavaScript Libraries (#1: Dojo Toolkit)
- UI (Usability != Aesthetics, Designing UI for ajax)
- Accessibility
- Troubleshooting and Testing(Glassbox, Selenuim 0.8.0 - supports frame)
- Semantic Web (tagging, RSS)
- Unobtrusive Dev
- Case Studies (Yahoo, Netflix)
- Mashup (here's a common example)
Subscribe to:
Posts (Atom)