05-20-2010, 03:18 AM | #1 |
Junior Member
Posts: 2
Karma: 10
Join Date: May 2010
Device: alex
|
How can i convert HTML or txt file to EPUB file ?
hi,
I worked in vs2005 c++ (MFC,win32). I need to work on my project to add html or txt file converted to epub formats. I used Calibre2,but it is too large and can not support c++,so i can not modify that source code . I do that is difficult... How can i get some free(or not free) source code for convert html or txt file to EPUB in VS2005 (MFC ,win32) ? thanks. |
05-20-2010, 07:26 AM | #2 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Write it yourself? Transforming of basic html to a basic epub is not that hard. What is it you want to do with your project that isn't covered with Calibre or Sigil.
|
Advert | |
|
05-20-2010, 10:13 PM | #3 |
Junior Member
Posts: 2
Karma: 10
Join Date: May 2010
Device: alex
|
thanks your reply.
write it myself. I just started learning EPUB.so ,I do not know what the reference data for convert html or txt file to EPUB. In html file include:text,picture,video,audio.... You said that is not hard. How can i start this project? thanks. |
05-21-2010, 04:17 AM | #4 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Read a lot about the epub format and create some epub's yourself by hand (I find the jedisaber site to be of great help there). Look at some epub's.
If the html includes video and/or audio, than epub is not the format for you. That is not covered. You can use font's and pictures though. By the way, you can call parts of Calibre from you project to convert to epub. So, you write some part and call a program of Calibre with your input. That should ease your project. |
05-21-2010, 10:42 PM | #5 |
Wizard
Posts: 1,213
Karma: 12890
Join Date: Feb 2009
Location: Amherst, Massachusetts, USA
Device: Sony PRS-505
|
An ePub file is just a .zip file containing (x)html along with associated images, fonts, and xml files containing metadata and a table of contents. See the Step by Step guide to ePub creation for links to learning more about the spec.
I don't know much about C, but I'm sure there are ways to use it to create xml and zip files, and if it can do that, it can create epubs. |
Advert | |
|
05-24-2010, 04:52 PM | #6 |
Wizard
Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
|
If you want to see some epub code in C++, then you should take a look at Sigil, which is GPL'd and should be fine for your use.
Sigil, of course, is a large editing project. The bits you'll want to examine are in the Exporters directory, which has code showing how to construct the NCX and OPF files you need. As frabjous said, the rest is just zipping up the component files and setting the mimetype (which must not be compresssed). |
05-27-2010, 08:49 PM | #7 |
Connoisseur
Posts: 98
Karma: 122982
Join Date: Apr 2010
Location: Humboldt County, California
Device: ipad, iPod touch, JetBook Lite
|
Read about EPUB at wikipedia, which has links to the formal specification. You can find open source XML parsers in C++, as well as zip libraries.
|
05-28-2010, 09:15 PM | #8 |
Addict
Posts: 260
Karma: 1014230
Join Date: Jan 2010
Device: Onyx Boox T68, Kobo Aura HD, Pocketbook 302, Pocketbook 912, Nook HD+
|
You might try the Inside epub blog. It's a series of articles about various components of an epub. It helped me quite a bit.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibre convert Chinese PDF to EPUB well, but not TXT and HTML | jimmyzou | ePub | 15 | 12-27-2013 04:02 PM |
Convert HTML file to MOBI for Kindle | IMFletch | Calibre | 5 | 04-16-2010 01:06 PM |
Plucker: can't right-click on html file to convert... | jplowman | Reading and Management | 1 | 08-08-2009 11:21 PM |
Adding pictures to epub from a txt file | p3aul | Calibre | 3 | 04-16-2009 06:05 PM |