News for hackers. Stuff that matters.
Re:HTML preview for doc, docx, pdf & rtf by afiler on Thursday May 19, 2011 @01:01PM (#2564592)
Prompted by downloading a .doc file from Qwest only to find out that inside was a monospaced text file, I set up a small, nearly UI-free site for doing document conversions. http://doc.mar.cx/<url>; gives an HTML or other sensible rendering of an url (e.g. http://doc.mar.cx/http://www.itu.int/dms_pub/itu-t/oth/02/02... ) and http://doc.mar.cx/<extension>/<url>; attempts to convert the url into the format with the given extension (e.g. http://doc.mar.cx/txt/http://www.itu.int/dms_pub/itu-t/oth/0... ).

I use wvHtml for doc->html, wvPDF for doc->pdf, but antiword for doc->txt. To convert .docx, .xls, .xlsx, and WordPerfect files to HTML, I use OpenOffice, by way of jodconverter. For ODF files, I use OdfConverter. Conversion of Excel files to .csv files uses xls2csv. For PowerPoint files, I use ppthtml to convert to html, and catppt to convert to text. For Lotus 1-2-3 files (I added this after downloading some historical telecom data from the FCC!), I use ssconvert.

Any conversion that results in an HTML file (e.g. doc or pdf to html) I bundle all the images into a single file using the data: url scheme. To do this, I wrote a utility called pagecan: http://afiler.com/pagecan/

Re:HTML preview for doc, docx, pdf & rtf by sushi on Thursday May 19, 2011 @06:40AM (#2563508)
UX Suggestion: Please hyperlink the Blog text besides the Recruiterbox logo. It's underlined so users expect it to be a link.
Re:HTML preview for doc, docx, pdf & rtf by p4bl0 on Thursday May 19, 2011 @06:44AM (#2563516)
Also, a <title> tag would be useful :-).

But apart from this, I now I'll face this very problem soon (well, for a relatively fluctuant value of "soon"), so thank you very much for sharing this _raghu!

Re:HTML preview for doc, docx, pdf & rtf by grease on Thursday May 19, 2011 @08:18AM (#2563664)
Thanks, yeah will do this :)
Re:HTML preview for doc, docx, pdf & rtf by bravura on Thursday May 19, 2011 @10:51AM (#2564070)
You should also consider 'pandoc', written in Haskell, for converting between markup formats: http://johnmacfarlane.net/pandoc/

I am curious for more details about why Tika wasn't good enough. Please explain.

Re:HTML preview for doc, docx, pdf & rtf by _raghu on Thursday May 19, 2011 @11:22AM (#2564198)
Tika is very good at converting documents to plain text. Very reliable too. The problem for us was that, most resumes have a lot of formatting in them. For example candidates use tables to structure data. When such a resume is converted to plain text using tika, it looks jumbled.

Will take a look at pandoc. Thanks for suggesting.

Re:HTML preview for doc, docx, pdf & rtf by kalmi10 on Thursday May 19, 2011 @11:14AM (#2564165)
Based on the title I expected some html5 magic for converting binary files into html in the browser.
Re:HTML preview for doc, docx, pdf & rtf by dpapathanasiou on Thursday May 19, 2011 @10:33AM (#2564010)
How would you compare abiword for doc/docx conversion versus antiword (http://www.winfield.demon.nl/)?

Also, what are the limitations of abiword for doc/docx files?

Re:HTML preview for doc, docx, pdf & rtf by _raghu on Thursday May 19, 2011 @11:26AM (#2564209)
Haven't tried antiword. As of now I find abiword pretty stable for both doc and docx. I need more data but I found a few cases where it just hanged while converting. There is no specific pattern to when the program hangs. For now I am logging such cases and timing out the conversion in 3 seconds.
Re:HTML preview for doc, docx, pdf & rtf by dpapathanasiou on Thursday May 19, 2011 @11:34AM (#2564229)
Thanks.

Where do you get your doc files?

Are they the just ones submitted to your site, or is there a pastebin or similar repo of doc files?

Re:HTML preview for doc, docx, pdf & rtf by tucosan on Thursday May 19, 2011 @10:05AM (#2563928)
How about trying out calibre http://calibre-ebook.com It can do all kinds of conversions from a number of formats, it is quite reliable, and it can be run headless.
Re:HTML preview for doc, docx, pdf & rtf by jamesshamenski on Thursday May 19, 2011 @11:08AM (#2564137)
Million Dollar Question:

How could you additionally parse the information to extract structured data? For example; names of candidates, addresses, previous employers, job titles held.

Re:HTML preview for doc, docx, pdf & rtf by earle on Thursday May 19, 2011 @11:15AM (#2564172)
That's been done across online job boards since 1996 when we launched hotjobs. Resumes, although varying aesthetically contain a pretty ridged structure that presents itself well to localized extraction. This allows easy term extraction for searching across a very large data set quickly.

A simple 30 line flex/yacc combo will work effectively at a high ninety percentile

Re:HTML preview for doc, docx, pdf & rtf by Jakob on Thursday May 19, 2011 @09:14AM (#2563795)
Please add a candidate delete function. I sent an email with candidate with multiple attachments and Recruiterbox created multiple candidates by mistake.
Re:HTML preview for doc, docx, pdf & rtf by nopal on Thursday May 19, 2011 @09:52AM (#2563890)
There's really not much here.

Could we see some code or a demo?