我想生成由Html定义的多媒体文档(所谓的MIME
)
因此,我可以在a single mhtml (MIME) file here
中打包相关文件(例如htm,图片...)(例如:mime_example.doc)。
但我只有php implementation here
:A basic MIME 1.0 class helper
(在“基本MIME 1.0类助手”部分)
和the method to generate
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))
答案 0 :(得分:0)
我不确定是否是一个单独的开源库来执行此操作,但是https://github.com/coolwanglu/pdf2htmlEX它将PDF转换为html并且它可以选择在单个html文件中打包相关文件(例如htm,images ...)(通过默认它没有),可能你可以使用这个项目的代码作为它的开源!