photobook/example/album.py

41 lines
938 B
Python

from photobook import Photobook
from pathlib import Path
name = "album"
pagesize = (250, 200)
src_fig = Path("./fig/")
output = Path("./build/")
dest = output / (name + ".pdf")
out_fig = output / "fig"
photobook = Photobook(name, pdf_size=pagesize, base_fig=src_fig, margin=5, img_px=2)
photobook.set_font("Arial", "B", 20)
photobook.set_auto_page_break(False)
photobook.set_fig_folder("textures")
photobook.one_centered("eugene.jpg", "one_centered default")
photobook.one_centered("eugene.jpg", "")
photobook.one_centered(
"eugene.jpg",
"one_centered text_ratio=1, img_ratio=1",
text_ratio=1,
img_ratio=1
)
photobook.one_side("eugene.jpg", "one_side default")
photobook.one_side(
"eugene.jpg",
"one_side text_ratio=1, img_ratio=1",
text_ratio=1,
img_ratio=1
)
photobook.one_side(
"eugene.jpg",
"one_side text_ratio=1, img_ratio=1",
text_ratio=1,
img_ratio=1
)
photobook.output(dest)