IMGKit gem generate unexpected values in image - ruby-on-rails

I'm using imgkit gem to create JPGs and PNGs from HTML, it is working fine in development, but in production server it does not showing text in images instead showing boxes other than text.
Example can be seen here

Related

Wicked PDF gem works locally but displays different font when deployed

I’m trying to generate PDFs in a Rails 4.2 app using the Wicked PDF gem and everything works fine locally. However, when deployed to other environments the PDF renders but most* of the text is displayed as what appears to be characters from “Cursor Font” which I've never seen before but it appears to be something bundled with X11.
*I say "most" because some of the PDF text renders normally if enclosed in certain html tags. For example, if I change p-tags to h1 tags, normal font is displayed, but obviously I don't want the entire document to look like one big header.
I checked the logs; no errors are being generated.
I’ve tried various combinations of Wicked gem versions and wkhtmltopdf binaries. Currently using gem 'wicked_pdf'and gem 'wkhtmltopdf-binary-edge'.
I’ve closely followed the Wicked PDF set-up documentation to include
PDF mime type, a wicked_pdf.rb initializer file, precompiled
assets, and absolute asset paths. Currently using (although have tried many variations) stylesheet_link_tag wicked_pdf_asset_base64("pdf.css.scss") and javascript_include_tag wicked_pdf_asset_base64("application")
Any ideas/advice on why this is happening is greatly appreciated!

How do you use the pdf-forms gem to form-fill a PDF with images?

I'm trying to put together several different pieces, and I'm not sure if it's even possible.
I know you can use the pdf-forms gem to form-fill a PDF in Ruby on Rails.
I know it's possible to create a form-fillable PDF with adobe acrobat.
I know it's possible to upload images into adobe acrobat form-fillable PDFs -- I've seen several forms that do this.
I'm trying to figure out how to line the pieces up so users can upload images, which are then (programmatically) form-filled into the PDF.

Not able to save Base64 Image using carrierwave gem in rails4

I want to save a image in base64 format sent by mobile device in my database. I have tried to install carrierwave-base64 Gem but no use. Can any one suggest me the right way to do it? I have tried all possible ways. I want clear code to upload a base64 image using carrierwave Gem.

Bootstrap date-picker image assets not displaying when deployed (on Heroku)

I am using gem 'bootstrap3-datetimepicker-rails', '~> 3.1.3' to include a date/time-picker in my web app, and it works in development, but when I deploy to Heroku the assets (icons) that the gem uses for up/down arrows and other icons are displaying as empty squares, as seen in this screenshot:
Any idea why these are displaying properly?
This is how it should look:
I am using Rails 4, Ruby 2, and I am deployed on Heroku, thanks!
UPDATE: After looking at the Heroku logs, I see this error:
ActionController::RoutingError (No route matches [GET] "/assets/bootstrap/glyphicons-halflings-regular.tttf")
In my app, I have "/assets/bootstrap/glyphicons-halflings-regular-0469longseriesoflettersandnumbers.tttf"), which is why it's not finding it. What do these letters/numbers mean? Can I safely remove them from the names of the files in Sublime Text? Thanks again
Found the answer here Glyphicon works locally but not on Heroku and here https://holarails.wordpress.com/2014/04/03/problem-twitter-bootstrap-glyphicons-not-show-in-heroku/.
If anyone has a better solution (as it looks like using this can affect performance), I'd appreciate it!

wicked_pdf, wkhtmltopdf not working with SVG on Heroku

I have a Ruby on Rails 3.2 app using the wicked_pdf gem and wkhtmltopdf 0.9.9 library to produce PDFs on my local machine, which is a MAC OSX 10.7.5 Lion. The app successfully renders HTML pages (that include SVG images) as PDF files, which is the exact behavior we're aiming for the app to accomplish.
On local, we had to use wkhtmltopdf 0.9.9 due to a bug on the 11.0.0 version for OSX.
The problem is that when the app is pushed to production on Heroku, it has to use a different binary: wkhtmltopdf-0.9.9 Linux Static Binary (amd64) and the SVG rendering seems to fall apart. A PDF is produced, but the SVG images are not rendered properly. They are simply blank or square "shells" where the images should be.
We tried using the wkhtmltopdf-heroku gem, but kept getting a "Broken Pipe" error.
There is no error message related to this issue and we don't know where the problem lies with the Linux versions. Any ideas out there?
This is our code in the config/initializers/wicked_pdf.rb file:
if Rails.env.staging? || Rails.env.production?
exe_path = Rails.root.join('bin', 'wkhtmltopdf-amd64').to_s
else
exe_path = Rails.root.join('bin', 'wkhtmltopdf').to_s
end
There is an easy way that works without having to do heavy tinkering and configuration – Base64-encode the SVG file and include it inline in your HTML:
<img src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGF...>
I use this method for embedding fonts in CSS, but it works with SVG and other image formats as well.

Resources