File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -268,9 +268,20 @@ pdf = WickedPdf.new.pdf_from_url('https://github.com/mileszs/wicked_pdf')
268
268
269
269
# create a pdf from string using templates, layouts and content option for header or footer
270
270
pdf = WickedPdf .new .pdf_from_string(
271
- render_to_string(' templates/pdf' , layout: ' pdfs/layout_pdf' ),
271
+ render_to_string(' templates/pdf' , layout: ' pdfs/layout_pdf.html ' ),
272
272
footer: {
273
- content: render_to_string(layout: ' pdfs/layout_pdf' )
273
+ content: render_to_string(
274
+ ' templates/footer' ,
275
+ layout: ' pdfs/layout_pdf.html'
276
+ )
277
+ }
278
+ )
279
+
280
+ # It is possible to use footer/header templates without a layout, in that case you need to provide a valid HTML document
281
+ pdf = WickedPdf .new .pdf_from_string(
282
+ render_to_string(' templates/full_pdf_template' ),
283
+ header: {
284
+ content: render_to_string(' templates/full_header_template' )
274
285
}
275
286
)
276
287
You can’t perform that action at this time.
0 commit comments