markup: process Documents inklist annotations
This commit is contained in:
@ -110,3 +110,22 @@ def write_debug_image(workdir, page_num, prods, scribbles):
|
||||
|
||||
img.save(path)
|
||||
set_file_perms(path)
|
||||
|
||||
|
||||
def write_inklist(obj, path):
|
||||
"""Draw an image of the inklist."""
|
||||
pagew = int(11*72)
|
||||
pageh = int(8.5*72)
|
||||
|
||||
img = Image.new('RGBA', (pagew, pageh), (0, 0, 0, 0))
|
||||
draw = ImageDraw.Draw(img, 'RGBA')
|
||||
|
||||
for segment in obj['InkList']:
|
||||
draw.line(segment, 'black', 3)
|
||||
|
||||
# account for the difference in coordinate systems
|
||||
# between pdf and images.
|
||||
img = img.transpose(Image.FLIP_TOP_BOTTOM)
|
||||
|
||||
img.save(path)
|
||||
set_file_perms(path)
|
||||
|
||||
Reference in New Issue
Block a user