PHP code example of nowo-tech / word-to-pdf-bundle
1. Go to this page and download the library: Download nowo-tech/word-to-pdf-bundle 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/ */
nowo-tech / word-to-pdf-bundle example snippets
use Nowo\WordToPdfBundle\Converter\WordToPdfConverterInterface;
use Nowo\WordToPdfBundle\Export\ExporterInterface;
use Nowo\WordToPdfBundle\Naming\PdfNaming;
public function download(WordToPdfConverterInterface $converter, ExporterInterface $exporter): Response
{
$pdf = $converter->convert('/path/to/contract.docx');
// Batch: $converter->convertMany([$pathA, $pathB], PdfNaming::suffix(' [converted]'));
return $exporter->toBinaryResponse($pdf);
}
bash
php bin/console nowo:word-to-pdf:check