Skip to content

Instantly share code, notes, and snippets.

@colinpetruno
Created July 25, 2019 16:00
Show Gist options
  • Save colinpetruno/03160b398215f4fbb9d2335239f8b3cc to your computer and use it in GitHub Desktop.
Save colinpetruno/03160b398215f4fbb9d2335239f8b3cc to your computer and use it in GitHub Desktop.
PDF Problems

Link to document:

https://drive.google.com/file/d/1cRgAdjkZNGR2IttjwZkNCxnuNf315QuH/view?usp=sharing

Background:

I have been working with the Origami gem to sign PDF's to replicate docusign but more EU compliant. However the gem is really basic and has quite a few errors in it that need corrected. For the most part, while going slow, it has progressed well. After a decent amount of QA there is still a subset of documents that don't work.

https://github.com/gdelugre/origami

Issue:

The signing works okay. However each subsequent signature / revision invalidates the previous one. However, the previous signature isn't invalid because deleting the later revision will bring the signature back to a valid state.

It is very similar to this article but I don't believe the document has any misformed bytes. https://forums.adobe.com/thread/877635

My guess:

There is something in the original document causing Adobe reader to make the prior revision invalid. I noticed the spec on "allowed changes" and when I sign other documents it works completely fine so I don't think the problem lays in the revision / signatures I add. I do not know about the certified signatures but I am pretty confident that this does not include any.

Some misc details

For some simple documents that exhibit this behavior, converting it from a table to a stream style document will allow it work. BUT, the document will say that there is 1 misc change added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment