Skip to content

Commit

Permalink
Merge pull request #603 from shiroginne/update-readme-with-examples
Browse files Browse the repository at this point in the history
Update README.md with examples for Super Advanced Usage
  • Loading branch information
unixmonkey authored Jan 5, 2017
2 parents cef5e69 + e399547 commit c10010c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,20 @@ pdf = WickedPdf.new.pdf_from_url('https://github.com/mileszs/wicked_pdf')

# create a pdf from string using templates, layouts and content option for header or footer
pdf = WickedPdf.new.pdf_from_string(
render_to_string('templates/pdf', layout: 'pdfs/layout_pdf'),
render_to_string('templates/pdf', layout: 'pdfs/layout_pdf.html'),
footer: {
content: render_to_string(layout: 'pdfs/layout_pdf')
content: render_to_string(
'templates/footer',
layout: 'pdfs/layout_pdf.html'
)
}
)

# It is possible to use footer/header templates without a layout, in that case you need to provide a valid HTML document
pdf = WickedPdf.new.pdf_from_string(
render_to_string('templates/full_pdf_template'),
header: {
content: render_to_string('templates/full_header_template')
}
)

Expand Down

0 comments on commit c10010c

Please sign in to comment.