2022-07-05 05:07:39 +00:00
|
|
|
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")
|
2022-07-05 05:13:04 +00:00
|
|
|
photobook.one_centered("eugene.jpg", "")
|
2022-07-06 04:29:54 +00:00
|
|
|
photobook.one_centered(
|
2022-07-07 04:43:02 +00:00
|
|
|
"eugene.jpg", "one_centered text_ratio=1, img_ratio=1", text_ratio=1, img_ratio=1
|
2022-07-06 04:29:54 +00:00
|
|
|
)
|
2022-07-05 05:07:39 +00:00
|
|
|
|
2022-07-06 04:29:54 +00:00
|
|
|
photobook.one_side("eugene.jpg", "one_side default")
|
|
|
|
photobook.one_side(
|
2022-07-07 04:43:02 +00:00
|
|
|
"eugene.jpg", "one_side text_ratio=1, img_ratio=1", text_ratio=1, img_ratio=1
|
2022-07-06 04:29:54 +00:00
|
|
|
)
|
|
|
|
photobook.one_side(
|
2022-07-07 04:43:02 +00:00
|
|
|
"eugene.jpg", "one_side text_ratio=1, img_ratio=1", text_ratio=1, img_ratio=1
|
2022-07-06 04:29:54 +00:00
|
|
|
)
|
2022-07-05 05:07:39 +00:00
|
|
|
|
2022-07-07 04:43:02 +00:00
|
|
|
photobook.grid_row(
|
|
|
|
[
|
|
|
|
["eugene.jpg", "eugene.jpg", "eugene.jpg"],
|
|
|
|
["eugene.jpg", "grid_row default", "eugene.jpg"],
|
|
|
|
["eugene.jpg", "eugene.jpg", "eugene.jpg"],
|
2022-07-06 16:19:52 +00:00
|
|
|
],
|
|
|
|
)
|
2022-07-07 04:43:02 +00:00
|
|
|
photobook.grid_row(
|
|
|
|
[
|
|
|
|
["eugene.jpg", "eugene.jpg"],
|
|
|
|
[
|
|
|
|
"eugene.jpg",
|
|
|
|
"grid_row\nlayout = \n[[1, 2], [1, 1, 1], [2, 1]]",
|
|
|
|
"eugene.jpg",
|
|
|
|
],
|
|
|
|
["eugene.jpg", "eugene.jpg"],
|
2022-07-06 16:19:52 +00:00
|
|
|
],
|
2022-07-07 04:43:02 +00:00
|
|
|
layout=[[1, 2], [1, 1, 1], [2, 1]],
|
2022-07-06 16:19:52 +00:00
|
|
|
)
|
2022-07-07 04:43:02 +00:00
|
|
|
photobook.grid_row(
|
|
|
|
[
|
|
|
|
["eugene.jpg", "eugene.jpg", "eugene.jpg"],
|
|
|
|
["eugene.jpg", "grid_row ratios=[1, 3, 1]", "eugene.jpg"],
|
|
|
|
["eugene.jpg", "eugene.jpg", "eugene.jpg"],
|
2022-07-06 16:19:52 +00:00
|
|
|
],
|
2022-07-07 04:43:02 +00:00
|
|
|
ratios=[1, 3, 1],
|
2022-07-06 16:19:52 +00:00
|
|
|
)
|
2022-07-07 04:43:02 +00:00
|
|
|
photobook.grid_row(
|
|
|
|
[
|
|
|
|
["eugene.jpg"],
|
|
|
|
["eugene.jpg", "grid_row ratios=[1, 3, 1]", "eugene.jpg"],
|
|
|
|
["eugene.jpg", "eugene.jpg"],
|
2022-07-06 16:19:52 +00:00
|
|
|
],
|
2022-07-07 04:43:02 +00:00
|
|
|
ratios=[1, 3, 1],
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
photobook.grid_column(
|
|
|
|
[
|
|
|
|
["eugene.jpg", "eugene.jpg", "eugene.jpg"],
|
|
|
|
["eugene.jpg", "grid_column default", "eugene.jpg"],
|
|
|
|
["eugene.jpg", "eugene.jpg", "eugene.jpg"],
|
|
|
|
],
|
|
|
|
)
|
|
|
|
photobook.grid_column(
|
|
|
|
[
|
|
|
|
["eugene.jpg", "eugene.jpg"],
|
|
|
|
[
|
|
|
|
"eugene.jpg",
|
|
|
|
"grid_column\nlayout = \n[[1, 2], [1, 1, 1], [2, 1]]",
|
|
|
|
"eugene.jpg",
|
|
|
|
],
|
|
|
|
["eugene.jpg", "eugene.jpg"],
|
|
|
|
],
|
|
|
|
layout=[[1, 2], [1, 1, 1], [2, 1]],
|
|
|
|
)
|
|
|
|
photobook.grid_column(
|
|
|
|
[
|
|
|
|
["eugene.jpg", "eugene.jpg", "eugene.jpg"],
|
|
|
|
["eugene.jpg", "grid_column ratios=[1, 3, 1]", "eugene.jpg"],
|
|
|
|
["eugene.jpg", "eugene.jpg", "eugene.jpg"],
|
|
|
|
],
|
|
|
|
ratios=[1, 3, 1],
|
|
|
|
)
|
|
|
|
photobook.grid_column(
|
|
|
|
[
|
|
|
|
["eugene.jpg"],
|
|
|
|
["eugene.jpg", "grid_column ratios=[1, 3, 1]", "eugene.jpg"],
|
|
|
|
["eugene.jpg", "eugene.jpg"],
|
|
|
|
],
|
|
|
|
ratios=[1, 3, 1],
|
2022-07-06 16:19:52 +00:00
|
|
|
)
|
|
|
|
|
2022-07-05 05:07:39 +00:00
|
|
|
photobook.output(dest)
|