knowbox/bud-slide

a lib for output pptx file from online format slides

Maintainers

👁 php-cpm

Package info

github.com/Knowbox-dev/bud-slide

pkg:composer/knowbox/bud-slide

Statistics

Installs: 5

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.6 2019-11-27 12:49 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 5067119bd466109fbac28376a648f219e7a9d97d

  • php-cpm <zouyi.woop@knowbox.cn>

paymentpaygatewaymerchantpurchaseomnipayalipay

This package is auto-updated.

Last update: 2026-06-28 04:02:09 UTC


README

web2ppt

pptx 类型 MIME TYPE 参考文档

https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types

// 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;