익명 07:47

Automatic conversion of PDF to blind-readable format

Automatic conversion of PDF to blind-readable format

I have a friend who's blind, and I have a PDF which I would like to give him to read.

The PDF is about 200 pages of beautifully-designed text (with a few pictures and figures containing text, but those are rare enough to be picked up by manual cleanup). Unfortunately, the logical structure of the PDF is represented badly: The PDF is unaware of its two-column text-flow, and none of the index and table-of-content entries are actually links.

I have easy access to a Linux machine and slightly-less-easy access to a Windows XP machine, and I know my way around regular expressions and scripting languages for automatizing post procession.

So far I have found a way to cut the PDF in half vertically (using code from http://snipplr.com/view/18924/split-crop-double-page-pdfs-in-two/, after converting the PDF to PDF1.4 so as to not contain a crossrefstream or whatever it was called), such that most content is in the right order, and then using pdftohtml to extract the text with some markup. Unfortunately, this is not able to reproduce the logical structure of the document (it recognizes some italic markings, but loses already all chapter, section and subsection headlines, which are always highlighted using consistent use of font size and colour, not to mention paragraph breaks etc.)

I had high hopes in Calibre, but that conversion tool cannot deal with badly-markedup two-column pdfs either, and also cannot derive structure from the fonts used, although it has some advantages for keeping paragraphs together.

How do I convert my PDF into a format suitable for access by a blind person?



Top Answer/Comment:

You could try using OpenDataLoader, which can auto-tag PDFs. This is integrated into pdftl, so you can run

pdftl in.pdf tag out.pdf

For this feature, I recommend you install with pipx install pdftl[full]. You also need a working java in your $PATH.

For more, see the tag operation documentation.

I believe the output of tag should help people using screenreaders. Unfortunately I haven't found out how to use a screenreader to test with (on linux). Tips or feedback welcome!

Disclaimer: I am the pdftl developer

상단 광고의 [X] 버튼을 누르면 내용이 보입니다