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 @@ -110,17 +110,19 @@ protected function getDefaultModuleValue(bool $isDark):array{
110
110
* Initializes an FPDF instance
111
111
*/
112
112
protected function initFPDF ():FPDF {
113
- return new FPDF ('P ' , $ this ->options ->fpdfMeasureUnit , $ this ->getOutputDimensions ());
113
+ $ fpdf = new FPDF ('P ' , $ this ->options ->fpdfMeasureUnit , $ this ->getOutputDimensions ());
114
+ $ fpdf ->AddPage ();
115
+
116
+ return $ fpdf ;
114
117
}
115
118
116
119
/**
117
120
* @inheritDoc
118
121
*
119
122
* @return string|\FPDF
120
123
*/
121
- public function dump (string $ file = null ){
122
- $ this ->fpdf = $ this ->initFPDF ();
123
- $ this ->fpdf ->AddPage ();
124
+ public function dump (string $ file = null , FPDF $ fpdf = null ){
125
+ $ this ->fpdf = ($ fpdf ?? $ this ->initFPDF ());
124
126
125
127
if ($ this ::moduleValueIsValid ($ this ->options ->bgColor )){
126
128
$ bgColor = $ this ->prepareModuleValue ($ this ->options ->bgColor );
You can’t perform that action at this time.
0 commit comments