pypdflite/pdflite.py
def _put_trailer(self):
        """ Final Trailer calculations, and end-of-file
            reference.

        """
        startxref = len(self.session.buffer)
        
        self._put_cross_reference()
        
        md5 = hashlib.md5()
        md5.update(datetime.now().strftime('%Y%m%d%H%M%S'))
        try:
            md5.update(self.filepath)
        except TypeError:
            pass
        if self.title:
            md5.update(self.title)
        if self.subject:
            md5.update(self.subject)
        if self.author:
            md5.update(self.author)
        if self.keywords:
            md5.update(self.keywords)
        if self.creator:
            md5.update(self.creator)
        
        objnum = len(self.session.objects)
        self.session._out('trailer')
        self.session._out('<<')
        self.session._out('/Size %s' % objnum)
        self.session._out('/Root %s 0 R' % (objnum - 1))
        self.session._out('/Info %s 0 R' % (objnum - 2))
        self.session._out('/ID [ <%s> <%s>]' % (md5.hexdigest(),md5.hexdigest()))
        self.session._out('>>')
        self.session._out('startxref')
        self.session._out(startxref)
        self.session._out('%%EOF')
def _put_trailer(self):
        """ Final Trailer calculations, and end-of-file
            reference.

        """
        startxref = len(self.session.buffer)
        
        self._put_cross_reference()
        
        md5 = hashlib.md5()
        md5.update(datetime.now().strftime('%Y%m%d%H%M%S'))
        try:
            md5.update(self.filepath)
        except TypeError:
            pass
        if self.title:
            md5.update(self.title)
        if self.subject:
            md5.update(self.subject)
        if self.author:
            md5.update(self.author)
        if self.keywords:
            md5.update(self.keywords)
        if self.creator:
            md5.update(self.creator)
        
        objnum = len(self.session.objects)
        self.session._out('trailer')
        self.session._out('<<')
        self.session._out('/Size %s' % objnum)
        self.session._out('/Root %s 0 R' % (objnum - 1))
        self.session._out('/Info %s 0 R' % (objnum - 2))
        self.session._out('/ID [ <%s> <%s>]' % (md5.hexdigest(),md5.hexdigest()))
        self.session._out('>>')
        self.session._out('startxref')
        self.session._out(startxref)
        self.session._out('%%EOF')
def _put_trailer ( self ) : startxref = len ( self . session . buffer ) self . _put_cross_reference ( ) md5 = hashlib . md5 ( ) md5 . update ( datetime . now ( ) . strftime ( '%Y%m%d%H%M%S' ) ) try : md5 . update ( self . filepath ) except TypeError : pass if self . title : md5 . update ( self . title ) if self . subject : md5 . update ( self . subject ) if self . author : md5 . update ( self . author ) if self . keywords : md5 . update ( self . keywords ) if self . creator : md5 . update ( self . creator ) objnum = len ( self . session . objects ) self . session . _out ( 'trailer' ) self . session . _out ( '<<' ) self . session . _out ( '/Size %s' % objnum ) self . session . _out ( '/Root %s 0 R' % ( objnum - 1 ) ) self . session . _out ( '/Info %s 0 R' % ( objnum - 2 ) ) self . session . _out ( '/ID [ <%s> <%s>]' % ( md5 . hexdigest ( ) , md5 . hexdigest ( ) ) ) self . session . _out ( '>>' ) self . session . _out ( 'startxref' ) self . session . _out ( startxref ) self . session . _out ( '%%EOF' )
Final Trailer calculations, and end-of-file
            reference.
Final Trailer calculations and end - of - file reference .