File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -109,15 +109,17 @@ protected function getDefaultModuleValue(bool $isDark):array{
109
109
* Initializes an FPDF instance
110
110
*/
111
111
protected function initFPDF ():FPDF {
112
- return new FPDF ('P ' , $ this ->options ->fpdfMeasureUnit , $ this ->getOutputDimensions ());
112
+ $ fpdf = new FPDF ('P ' , $ this ->options ->fpdfMeasureUnit , $ this ->getOutputDimensions ());
113
+ $ fpdf ->AddPage ();
114
+
115
+ return $ fpdf ;
113
116
}
114
117
115
118
/**
116
119
* @inheritDoc
117
120
*/
118
- public function dump (string $ file = null ):string |FPDF {
119
- $ this ->fpdf = $ this ->initFPDF ();
120
- $ this ->fpdf ->AddPage ();
121
+ public function dump (string $ file = null , FPDF $ fpdf = null ):string |FPDF {
122
+ $ this ->fpdf = ($ fpdf ?? $ this ->initFPDF ());
121
123
122
124
if ($ this ::moduleValueIsValid ($ this ->options ->bgColor )){
123
125
$ bgColor = $ this ->prepareModuleValue ($ this ->options ->bgColor );
You can’t perform that action at this time.
0 commit comments