PHP code example of aoxiaoxi / office2pdf

1. Go to this page and download the library: Download aoxiaoxi/office2pdf 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/ */

    

aoxiaoxi / office2pdf example snippets


use Lib\Office2pdf;

public function testComposer(){
        $office = new Office2pdf();
        $office->index();
}

//office to pdf
@param $filePath,
@param $pdffilePath
$office->office2pdf($filePath,$pdffilePath)


//pdf addwatermark
@param $waterName,
@param $oldfilepath
@param $newfilepath
$office->addwatermark($waterName,$oldfilepath,$newfilepath)