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 

Need help on your next project or application?

I specialize in Ruby-on-Rails, AngularJS, Javascript, Bootstrap, and Hybrid Mobile Apps with Cordova & Ionic.

Contact Me

Recommended Posts