Skip to content

Commit c10010c

Browse files
authored
Merge pull request #603 from shiroginne/update-readme-with-examples
Update README.md with examples for Super Advanced Usage
2 parents cef5e69 + e399547 commit c10010c

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

README.md

+13-2
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,20 @@ pdf = WickedPdf.new.pdf_from_url('https://github.com/mileszs/wicked_pdf')
268268

269269
# create a pdf from string using templates, layouts and content option for header or footer
270270
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'),
272272
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')
274285
}
275286
)
276287

0 commit comments

Comments
 (0)