Salut Peter--252 !
This is a very good question, and it's a bit of a tricky one because there isn't really a direct equivalent to this kind of phrasing in English.
This isn't a set construction; rather, it's an example of one way in which you can use an indirect object pronoun.
To start at the beginning, indirect object pronouns like me, te, lui, etc. are generally used to show who or what is indirectly receiving the action in a sentence - plainly put, it stands in for the person/thing to or for whom an action is being done. Sometimes, as well, indirect object pronouns are used to show the person/thing who is either a) benefiting from the action or b) at a disadvantage because of the action. That's what is happening here: the m' in m'a avalé is showing that the person speaking is at a disadvantage because the printer swallowed the document. It might be helpful to think of it as being a bit like the colloquial phrase "on me" in English - as in, "It went and swallowed my document on me."
I hope that this was helpful! Do let me know if you still have any questions.
À la prochaine,