Ideal “intermediate” file format to use for structured/styled text? [closed]

I have files that I want to make available in an variety of formats:

  • HTML
  • PDF
  • EPUB
  • Plain Text (maybe)

Most of the files will be sourced in doc, docx, or rtf format, so that needs to be considered.

So I need some kind of format that converts well from docx, doc, and rtf and has plenty of libraries for converting into PDF, EPUB, HTML etc. Ideally libraries in Python, but Java is also okay.

3

“doc” and “rtf” can be easily converted to “docx” using MS Word. “docx” can be can be converted to PDF, EPUB, HTML or plain text either by Word’s buildin converters, or by third party tools.

Here is a link telling you more about a clean Word->HTML conversion: http://webdesign.about.com/od/beginningtutorials/qt/doc-to-html.htm

For Word->EPUB a simple google search will reveal you some free online converters and some commercial tools.

If, for what reasons ever, you don’t like that solution and want a more “vendor neutral” intermediate format, then use docbook. But don’t expect that this will increase the overall quality of the results, since every additional step in the conversion chain will most probably add some additional data loss.

When searching for the intermediate format, there is always a problem with presentational vs. structural markup problem.

Typically, DocBook or LaTeX sources use the clear structural markup with usually few exceptions (misuses) caused by the author.

On the other hand, Word users tend to use mainly the presentational markup (explicitly telling the block of text the font size, font family, weight, …). Word allows the structural markup, but it is not forced too much.

Plain HTML is clearly structural, but the span and the like element allow to attach a lot of attributes to the block of text in the non-structural manner. You can clearly see the difference between the manually created HTML, technically generated HTML, and the documents converted from Word docs. Therefore, it may be difficult to find a common denominator even for HTML documents. The XML adds even more possibilities that can be misused.

But if you want to have one format that covers everything, then it probably should be XML. However, it may be one with document type designed by you for the purpose. The good thing is that there are tools for verification of your intermediate XML document. This way, you can be later sure that there is a way to the final form.

My guess is that it is almost impossible to convert various sources to the intermediate format with the good quality. It depends a lot on who created the souces. It is likely you will have to write a lot of parser for special subsets of the documents.

Python is probably a good choice. It depends on your knowledge. If you are better in Java or Perl, they can be better. I would prefer Python. (I do not have a good working knowlege of Java, and my Perl knowledge is rusty because I have found Python much better for me.)

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật