PhpSpreadsheet
PhpSpreadsheet copied to clipboard
Mpdf options: exposeVersion -> false
This is:
- [ ] a bug report
- [ ] a feature request
- [x] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)
What is the expected behavior?
When registering Mpdf as a writer, I cannot pass configuration, and would like to pass the exposeVersion option as false Can I do this somehow with your repo setup?
I don't know that we want to get into the business of directly supporting all configuration options for products with which we interface. But I believe you should be able to do what you want by extending the Mpdf class.
use PhpOffice\PhpSpreadsheet\Writer\Pdf\Mpdf;
class Mpdf2 extends Mpdf
{
protected function createExternalWriterInstance($config)
{
$config['exposeVersion'] = false;
return new \Mpdf\Mpdf($config);
}
}
...
$writer = new Mpdf2($spreadsheet);
$writer->save(...);