How To Fix Prawn Line Not Rendering

Posted by Weston Ganger on March 03, 2016

I was struggling with the issue of a pdf.line that wasnt showing up in my prawn pdf. Some were working and some werent.

The trick is to change it use stroke_line

# Change This Line
pdf.line [20, pdf.cursor], [100, pdf.cursor]

# To This
pdf.stroke_line [20, pdf.cursor], [100, pdf.cursor]

On reason you may have tried this is because the documentation link that comes up when you Google ‘prawn’ is not up to date. Make sure your reading the latest documentation or manual for prawn.

Related External Links:

Posted in Rails and Tagged with rails prawn pdf 

Want me to help develop your next project or application?

Contact Us

Specializing in Ruby-on-Rails, Javascript, Multi-Platform Electron Desktop Apps and Hybrid Cordova Mobile Apps.

Recommended Posts