@@ -17,7 +17,9 @@ class PdfManager
1717 $ pageCounterText = null ,
1818 $ header = null ,
1919 $ footer = null ,
20- $ body = null ;
20+ $ body = null ,
21+ $ headerCss = null ,
22+ $ footerCss = null ;
2123 private ?float $ marginTop = null ,
2224 $ marginBottom = null ,
2325 $ marginLeft = null ,
@@ -132,6 +134,30 @@ public function setPageCounterText(?string $pageCounterText = null): self
132134 return $ this ;
133135 }
134136
137+ public function setHeaderCss (string $ headerCss ): self
138+ {
139+ $ this ->headerCss = $ headerCss ;
140+
141+ return $ this ;
142+ }
143+
144+ public function setFooterCss (string $ footerCss ): self
145+ {
146+ $ this ->footerCss = $ footerCss ;
147+
148+ return $ this ;
149+ }
150+
151+ public function getHeaderCss (): string
152+ {
153+ return $ this ->headerCss ?? config ('pdf-manager.header.css ' );
154+ }
155+
156+ public function getFooterCss (): string
157+ {
158+ return $ this ->footerCss ?? config ('pdf-manager.footer.css ' );
159+ }
160+
135161 public function getPageCounterX (): float
136162 {
137163 return (float ) ($ this ->pageCounterX ?? config ('pdf-manager.page_counter.x ' , 10 ));
@@ -210,7 +236,7 @@ public function make(string $type = null)
210236 }
211237 }
212238
213- public function save (string $ path , ?string $ disk = null ): string
239+ public function save (? string $ path = null , ?string $ disk = null ): string
214240 {
215241 $ view = $ this ->getViewContent ();
216242 $ pdf = $ this ->parseView ($ view );
@@ -227,7 +253,9 @@ private function getViewContent(): string
227253 return view ($ this ->layout , [
228254 'structure ' => $ this ->replaces ($ this ->body ),
229255 'header ' => $ this ->header ,
256+ 'headerCss ' => $ this ->getHeaderCss (),
230257 'footer ' => $ this ->footer ,
258+ 'footerCss ' => $ this ->getFooterCss (),
231259 'marginTop ' => $ this ->getMarginTop (),
232260 'marginBottom ' => $ this ->getMarginBottom (),
233261 'marginRight ' => $ this ->getMarginRight (),
0 commit comments