Merging upstream version 0.7.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
e69e30697e
commit
e337ad61c4
5 changed files with 47 additions and 5 deletions
|
@ -9,7 +9,7 @@ from codecs import BOM_UTF16_BE
|
|||
from hashlib import md5
|
||||
from math import ceil, log
|
||||
|
||||
VERSION = __version__ = '0.6.0'
|
||||
VERSION = __version__ = '0.7.0'
|
||||
|
||||
|
||||
def _to_bytes(item):
|
||||
|
@ -549,11 +549,11 @@ class PDF:
|
|||
object_.generation))
|
||||
xref.append((1, self.current_position, 0))
|
||||
|
||||
field2_size = ceil(log(self.current_position, 8))
|
||||
field2_size = ceil(log(self.current_position + 1, 256))
|
||||
max_generation = max(
|
||||
object_.generation for object_ in self.objects)
|
||||
field3_size = ceil(log(
|
||||
max(max_generation, len(compressed_objects)), 8))
|
||||
max(max_generation, len(compressed_objects)) + 1, 256))
|
||||
xref_lengths = (1, field2_size, field3_size)
|
||||
xref_stream = b''.join(
|
||||
value.to_bytes(length, 'big')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue