Merge pull request #1907 from SailorMax/patch-2
Allow to redefine TCPDF object
This commit is contained in:
commit
e3732ef610
|
|
@ -36,6 +36,20 @@ class TCPDF extends AbstractRenderer implements WriterInterface
|
||||||
*/
|
*/
|
||||||
protected $includeFile = 'tcpdf.php';
|
protected $includeFile = 'tcpdf.php';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the implementation of external PDF library that should be used.
|
||||||
|
*
|
||||||
|
* @param string $orientation Page orientation
|
||||||
|
* @param string $unit Unit measure
|
||||||
|
* @param string $paperSize Paper size
|
||||||
|
*
|
||||||
|
* @return \TCPDF implementation
|
||||||
|
*/
|
||||||
|
protected function createExternalWriterInstance($orientation, $unit, $paperSize)
|
||||||
|
{
|
||||||
|
return new \TCPDF($orientation, $unit, $paperSize);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save PhpWord to file.
|
* Save PhpWord to file.
|
||||||
*
|
*
|
||||||
|
|
@ -50,7 +64,7 @@ class TCPDF extends AbstractRenderer implements WriterInterface
|
||||||
$orientation = 'P';
|
$orientation = 'P';
|
||||||
|
|
||||||
// Create PDF
|
// Create PDF
|
||||||
$pdf = new \TCPDF($orientation, 'pt', $paperSize);
|
$pdf = $this->createExternalWriterInstance($orientation, 'pt', $paperSize);
|
||||||
$pdf->setFontSubsetting(false);
|
$pdf->setFontSubsetting(false);
|
||||||
$pdf->setPrintHeader(false);
|
$pdf->setPrintHeader(false);
|
||||||
$pdf->setPrintFooter(false);
|
$pdf->setPrintFooter(false);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue