sandal/prawn — Issue #319: in `generate_margin_box': undefined method `[]' for 54 0 R:Prawn::Core::Reference (NoMethodError)
Author: gmitrev
Created: 2012-01-23 08:58:32+00:00
State: open

This is coming out after executing the following code:

```ruby
require 'prawn'

filename = "policy.pdf"

Prawn::Document.generate "output.pdf", template: filename do
image "sign.png", width: 60, at: [400, 240]
end
```

What it basically does is take a pdf and stamp a signature on it. This has been working for several months and today it threw the following exception:
```/home/georgi/.rvm/gems/ruby-1.9.2-p290@rails309/gems/prawn-0.12.0/lib/prawn/document.rb:666:in `generate_margin_box': undefined method `[]' for 54 0 R:Prawn::Core::Reference (NoMethodError)
from /home/georgi/.rvm/gems/ruby-1.9.2-p290@rails309/gems/prawn-0.12.0/lib/prawn/document.rb:308:in `go_to_page'
from /home/georgi/.rvm/gems/ruby-1.9.2-p290@rails309/gems/prawn-0.12.0/lib/prawn/document/internals.rb:98:in `block in fresh_content_streams'
from /home/georgi/.rvm/gems/ruby-1.9.2-p290@rails309/gems/prawn-0.12.0/lib/prawn/document/internals.rb:97:in `each'
from /home/georgi/.rvm/gems/ruby-1.9.2-p290@rails309/gems/prawn-0.12.0/lib/prawn/document/internals.rb:97:in `fresh_content_streams'
from /home/georgi/.rvm/gems/ruby-1.9.2-p290@rails309/gems/prawn-0.12.0/lib/prawn/document.rb:199:in `initialize'
from /home/georgi/.rvm/gems/ruby-1.9.2-p290@rails309/gems/prawn-0.12.0/lib/prawn/document.rb:121:in `new'
from /home/georgi/.rvm/gems/ruby-1.9.2-p290@rails309/gems/prawn-0.12.0/lib/prawn/document.rb:121:in `generate'
from pdf.rb:5:in `

'
```