# Path: layout/rl_utils.py
# def render_to_reportlab_canvas(rl_canvas, papersize_tuple, layout):
# def render_to_reportlab_document(output_filename, papersize_tuple, layout):
#     def __init__(self, rl_canvas):
#     def _save_state(self):
#     def _restore_state(self):
#     def translate(self, x, y):
#     def scale(self, x, y):
#     def rotate(self, degrees):
#     def text_width(self, text, *, font_name, font_size):
#     def draw_text(self, text, x, y, *, font_name, font_size, fill):
#     def draw_line(
#             self, x0, y0, x1, y1, *,
#             stroke,
#             stroke_width=1,
#             stroke_dash=None):
#     def draw_rect(
#             self, x, y, w, h, *,
#             stroke=None,
#             stroke_width=1,
#             stroke_dash=None,
#             fill=None
#             ) -> None:
#     def draw_image(self, img_filename, x, y, w, h):
#     def draw_polygon(
#             self,
#             *pts,
#             close_path=True,
#             stroke=None,
#             stroke_width=1,
#             stroke_dash=None,
#             fill=None
#             ) -> None:
#     def end_page(self):
#     def clip_rect(self, x, y, w, h):
#     def __init__(self, filename):
#     def get_minimum_size(self, data):
#     def render(self, rectangle, data):
# class ReportlabOutput(output.OutputTarget):
# class PDFImage(root.LayoutElement):


import os.path
import sys
from layout.elements import *
from layout.managers import *
from layout.managers.root import *
from layout.datatypes import *
from layout.pages.imposition import *
from layout.pages.output import *
from layout import rl_utils

BASE_DIR = os.path.dirname(__file__)
sys.path.append(os.path.abspath(os.path.join(BASE_DIR, '..')))


def create_pocketmod(papersize):
    pages = [
        OverlayLM([
                Border(),
                TextLine(str(i+1), font_size=72, align=TextBase.ALIGN_CENTER)
                ])
        for i in range(8)
        ]

    pps = []
    for i in range(4):

# Path: layout/rl_utils.py
# def render_to_reportlab_canvas(rl_canvas, papersize_tuple, layout):
# def render_to_reportlab_document(output_filename, papersize_tuple, layout):
#     def __init__(self, rl_canvas):
#     def _save_state(self):
#     def _restore_state(self):
#     def translate(self, x, y):
#     def scale(self, x, y):
#     def rotate(self, degrees):
#     def text_width(self, text, *, font_name, font_size):
#     def draw_text(self, text, x, y, *, font_name, font_size, fill):
#     def draw_line(
#             self, x0, y0, x1, y1, *,
#             stroke,
#             stroke_width=1,
#             stroke_dash=None):
#     def draw_rect(
#             self, x, y, w, h, *,
#             stroke=None,
#             stroke_width=1,
#             stroke_dash=None,
#             fill=None
#             ) -> None:
#     def draw_image(self, img_filename, x, y, w, h):
#     def draw_polygon(
#             self,
#             *pts,
#             close_path=True,
#             stroke=None,
#             stroke_width=1,
#             stroke_dash=None,
#             fill=None
#             ) -> None:
#     def end_page(self):
#     def clip_rect(self, x, y, w, h):
#     def __init__(self, filename):
#     def get_minimum_size(self, data):
#     def render(self, rectangle, data):
# class ReportlabOutput(output.OutputTarget):
# class PDFImage(root.LayoutElement):


# Path: examples/pocketmod.py
import os.path
import sys
from layout.elements import *
from layout.managers import *
from layout.managers.root import *
from layout.datatypes import *
from layout.pages.imposition import *
from layout.pages.output import *
from layout import rl_utils


BASE_DIR = os.path.dirname(__file__)
sys.path.append(os.path.abspath(os.path.join(BASE_DIR, '..')))


def create_pocketmod(papersize):
    pages = [
        OverlayLM([
                Border(),
                TextLine(str(i+1), font_size=72, align=TextBase.ALIGN_CENTER)
                ])
        for i in range(8)
        ]

    pps = []
    for i in range(4):

        pps.extend(get_pocketmod_pages(pages, i % 2 > 0, i // 2 > 0))