README.md in wisepdf-1.2.10 vs README.md in wisepdf-1.3.0
- old
+ new
@@ -23,12 +23,16 @@
Add this to your Gemfile:
gem 'wisepdf'
+if you don't already have wkhtmltopdf installed on your machine you can get up and running quickly by adding this to your Gemfile:
+
+ gem 'wkhtmltopdf-binary'
+
then do:
-
+
bundle install
## How does it work?
### Basic Usage
@@ -123,14 +127,14 @@
If you need to just create a pdf and not display it:
# create a pdf from a string
pdf = Wisepdf::Writer.new.to_pdf('<h1>Hello There!</h1>')
-
+
# or from your controller, using views & templates and all other options as normal
pdf = render_to_string :pdf => "some_file_name"
-
+
# then save to a file
save_path = Rails.root.join('pdfs','filename.pdf')
File.open(save_path, 'wb') do |file|
file << pdf
end
@@ -198,22 +202,22 @@
Wisepdf::Configuration.configure do |c|
c.wkhtmltopdf = '/path/to/wkhtmltopdf'
c.options = {
:layout => "layout.html",
:use_xserver => true,
- :footer => {
+ :footer => {
:right => "#{Date.today.year}",
:font_size => 8,
:spacing => 8
},
:margin => {
:bottom => 15
}
}
-
+
end
-
+
### Problems with with wkhtmltopdf-0.10 and above?
If you experience problems with wkhtmltopdf-0.10 and above like getting `Broken Pipe` error or something similar, then you probably should compile wkhtmltopdf from source.
To do this you will have to:
@@ -236,10 +240,10 @@
However, the wisepdf_* helpers will use file:// paths for assets when using :show_as_html, and your browser's cross-domain safety feature will kick in, and not render them. To get around this, you can load your assets like so in your templates:
<%= params[:debug].present? ? image_tag('foo') : wisepdf_image_tag('foo') %>
-## Production?
+## Production?
**wisepdf** is used at:
* [www.sdelki.ru](http://www.sdelki.ru)
* [www.lienlog.com](http://www.lienlog.com)