简体   繁体   中英

Rails gem prawn - undefined method `[]' for Float in horizontal line with a specific location

I'm using Prawn gem to generate the PDF file (A4 format). I want to have two horizontal lines/folding marks which should be available: 105 mm from top of the document, 1pt line, #000. From what I know I could call something like:

stroke_horizontal_line(0, 1, 105.mm)

But I'm getting an error:

NoMethodError (undefined method `[]' for 297.6377952755906:Float):

(eval):2:in `stroke_horizontal_line'

I believe stroke_horizontal_line expects the third argument to be a hash. You need to include the key before the data.

stroke_horizontal_line(0, 1, at: 105.mm)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM