2013-02-26 115 views
0

我想生成由Html定义的多媒体文档(所谓的MIME)。
因此,我可以在a single mhtml (MIME) file here(如:mime_example.doc)中打包相关文件(例如htm,images ...)。
但我只得到了php implementation hereA basic MIME 1.0 class helper
(在 “基本MIME 1.0级帮手” 一节)
the method to generate的MHTML文件:如何用C++生成mhtml文件?

header('Content-Type: application/msword'); 
header('Content-disposition: filename=mydocument.doc') 
$doc = New mime10class(); 
$doc->addFile('mydocument.htm','text/html; charset="utf-8"','Hello, world !'); 
$doc->addFile('subdir\anotherfile.htm','text/html; charset="utf-8"','Hi there.'); 
echo $doc->getFile(); 

但如何实现这个用C++?
(有用的链接:MIME Encapsulation of Aggregate Documents, such as HTML (MHTML)

+1

http://code.google.com/p/chromium/codesearch#chromium/src/content/renderer/mh​​tml_generator.cc – 2013-02-26 11:00:30

+0

您可以随时将正确格式化的文本转换为字符串(流)... – PlasmaHH 2013-02-26 11:01:13

+0

@aleguna :但我不想做一个铬。 – Al2O3 2013-02-26 11:03:27

回答

0

我不知道是否是一个独立的开源库,做到这一点,但https://github.com/coolwanglu/pdf2htmlEX其将PDF转换为HTML和它得到选项打包相关文件(如HTM,图片...)在一个单独的html文件(默认情况下它不会),也许你可以使用这个项目的代码作为它的开源!