def get_trailer_object(last_obj):
    """Get the document's trailer object."""

    # if trailer is found, try to do a proper injection
    trailer = '\ntrailer\n'
    trailer += f"<</Size {last_obj}/Root<</AcroForm<</XFA {last_obj} "
    trailer += "0 R>>/Pages<<>>>>>>"

    return trailer.encode('utf-8')