gdelugre / origami

Origami is a pure Ruby library to parse, modify and generate PDF documents.
GNU Lesser General Public License v3.0
322 stars 109 forks source link

Origami::InvalidPDFError: No trailer found, in pdf.sign() when using pdf file (v1.5) #51

Open yvonnenieuwerth opened 5 years ago

yvonnenieuwerth commented 5 years ago

We generated a version 1.5 pdf file, which can be 'read' by origami, but as soon as we try to 'sign' and save it, we get the following error:

 Origami::InvalidPDFError:
       No trailer found
     # /Users/yvonne/.rvm/gems/ruby-2.5.1/gems/origami-2.1.0/lib/origami/trailer.rb:47:in `trailer'
     # /Users/yvonne/.rvm/gems/ruby-2.5.1/gems/origami-2.1.0/lib/origami/pdf.rb:809:in `output'
     # /Users/yvonne/.rvm/gems/ruby-2.5.1/gems/origami-2.1.0/lib/origami/pdf.rb:223:in `save'

Without the 'sign' method, the save works fine. We also tried it with pdf version 1.4, and that seems to work fine also. The pdf files are generated by princexml.

The pdf file used: pdf_to_sign.pdf

It might be related to issue https://github.com/gdelugre/origami/issues/16 , but the error message is different, and also said to be fixed in an earlier version.

nogdacosta commented 4 years ago

Is there any update on this issue?