knowbox / bud-slide
a lib for output pptx file from online format slides
v1.0.6
2019-11-27 12:49 UTC
Requires
- ext-gd: *
- ext-xmlwriter: *
- ext-zip: *
- phpoffice/phppresentation: dev-develop
Requires (Dev)
- roave/security-advisories: dev-master
README
web2ppt
pptx 类型 MIME TYPE 参考文档
// function webToPpt($data, $type = 'pptx', $tmpfilePath='/tmp/budpptconvert.pptx') header("Content-Type: application/vnd.openxmlformats-officedocument.presentationml.presentation"); $data = file_get_contents($webPptData); $data = json_encode($data, true); $convert = new PptConvert(); $pptx = $convert->webToPpt($data, 'pptx', '/tmp/budpptconvert.pptx'); $size = strlen($pptx); $filename = 'download.pptx'; header("Content-length: $size"); header('Content-Disposition: attachment; filename="' . $filename . '"'); echo $pptx;
ppt2web
// function pptToWeb($pptPath, $type = 'pptx', $tmpfilePath='/tmp/budpptconvert/') header("Content-Type: application/json"); $data = file_get_contents($webPptData); $convert = new PptConvert(); $json = $convert->pptToWeb('a.pptx', 'pptx', '/tmp/budpptconvert/'); echo $json;