Image and print_media_type for pdfkit are not working on rails 4.0.2 -
I have created a PDF using pdfkit.pdf. But the image on my PDF is not being displayed and print_modia type is not working either. I am using Rails 4.0.2 and Ruby 2.0.0. Can anyone help me solve this problem? I am attaching the details here thanks.
Mani file: application.css: application.rb: config / initializers / pdfkit.rb: application.html.erb: use or
Mani 'pdfkit', '0.5.2' Mani 'wkhtmltopdf-binary', '0.9 9.1' Mani ' Wichtmltopdf-heroku ',' 1.0.0 '
@ media print {body {text- Alignment: justification; Font-size: 566px; Background color: red; }}
"pdfkit" requires config.middleware.use PDFKit :: Middleware, : Print_media_type = & gt; True
PDFKit.configure do | Config | Config.wkhtmltopdf = 'C: \ Program Files \ wkhtmltopdf \ bin \ wkhtmltopdf.exe' config.default_options = {: page_size = & gt; 'A4' ,: Page_Hut = & gt; '2478',: footer_right = & gt; "1in" ,: "1in",: margin_bottom = & gt; "0.5in",: margin_left = & gt; "1in" ,: "Page [page] [toPage]",: margin_top => "0.5in" ,: margin_right = & gt; Zoom = & gt; '1.5',: disable_smart_shrinking = & gt; Wrong, print_media_type = & gt; True} config.root_url = "// localhost" end
& lt;% = Stylesheet_link_tag "app" ,: media = gt; "All", "data-turbo-lines-track" = & gt; True% & gt; `& Lt;% = javascript_include_tag" application "," data-turbo-lines-track "= & gt; True% & gt; `& Lt; Body & gt; & Lt;% = image_tag "rails.png", Size: "725x150"%> & Lt; / Body & gt;
& lt; Img src = "& lt;% = root_url%> /rails.png" height = "725" width = "150" & gt;
& lt; Img src = "& lt;% = root_url%> /assets/rails.png" height = "725" width = "150" & gt;
Comments
Post a Comment