Open giuseb opened 9 years ago
I'm having problems with this as well. The root of the problem, as far as I can tell, is that create_box_clone
creates a new Prawn::Document
and tries to run the block of code on it, instead of running it in the context of a MyView
instance. When I tried to make it run in a copy of the view, it did run, but it wrote the text twice on the final pdf (so 5 lines instead of 3 in your example).
I may have found a caveat in the gem. The currently recommended way to wrap Prawn in a custom class is to
include Prawn::View
, rather than inheriting fromPrawn::Document
, as it used to be the case.But the following program will fail. Please let me know if it's too cryptic, I will provide more details (but see the Views page in Prawn's manual)
Ciao, Giuseppe