Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/PhpWord/Writer/PDF/TCPDF.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ class TCPDF extends AbstractRenderer implements WriterInterface
*/
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.
*
Expand All @@ -50,7 +64,7 @@ public function save($filename = null)
$orientation = 'P';

// Create PDF
$pdf = new \TCPDF($orientation, 'pt', $paperSize);
$pdf = $this->createExternalWriterInstance($orientation, 'pt', $paperSize);
$pdf->setFontSubsetting(false);
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
Expand Down