PHP code example of knowbox / bud-slide

1. Go to this page and download the library: Download knowbox/bud-slide library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

knowbox / bud-slide example snippets


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

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