Please write list of vocabulary words with it's meaning for my 4th grade ESL student,and later write 15 conversation questions for intensive speaking practice test for Cambridge speaking practice along with answers using the similar vocabulary from attached file,only use present simple and present continuous tense and future simple.
cd /tmp/workspace/attachments/8ca4e69d-0b9d-43f8-a1c5-f938f37bccc1/ && python3 -c " import pdfplumber with pdfplumber.open('DOC-20261101-WA0008.pdf') as pdf: print(len(pdf.pages)) for p in pdf.pages: print('---PAGE');print(p.extract_text()) "
mkdir -p /tmp/workspace/esl && cd /tmp/workspace/esl && python3 -c " import pdfplumber with pdfplumber.open('/tmp/workspace/attachments/8ca4e69d-0b9d-43f8-a1c5-f938f37bccc1/DOC-20261101-WA0008.pdf') as pdf: for i,p in enumerate(pdf.pages): p.to_image(resolution=110).save(f'p{i+1}.png') print(p.width,p.height,len(p.images)) "; ls -la
| Word | Meaning (simple) | Example sentence |
|---|---|---|
| cream | A thick, white liquid from milk. We put it in coffee or on cake. | I put cream in my hot chocolate. |
| sugar | A sweet, white food. It comes in small cubes or tiny grains. | Sugar makes tea sweet. |
| salt | A white powder that makes food taste salty. | My dad puts salt on his eggs. |
| pour | To make a liquid go from one place into another. | I pour juice into my glass. |
| plastic bags | Thin, clear bags we use to carry or keep things. | Mom puts sandwiches in plastic bags. |
| mixture | Two or more things that you put together. | The cookie mixture is in the bowl. |
| open | Not shut. You can go in or see through. | The door is open. |
| closed | Shut. You cannot go in or see through. | The window is closed. |
| freezer | A very cold box in the kitchen. It keeps food frozen. | Ice cream stays in the freezer. |
| Word | Meaning (simple) | Example sentence |
|---|---|---|
| cause | The reason why something happens. | The cause is: I am cold. |
| effect | What happens after the cause. | The effect is: I drink hot tea. |
| ice cream | A cold, sweet food. | Ice cream is cold and sweet. |
| party | A fun time with friends, food, and games. | We have a party on Saturday. |
| play | A story that actors act on a stage. | Our class is in a play. |
| stage | The place where actors act. | The actors stand on the stage. |
| actor | A person who acts in a play. | The actor is very funny. |
| feel awful | To feel very bad or sick. | I feel awful when I am sick. |
| cold | Not warm. Having low temperature. | The freezer is very cold. |
| warm | A little hot. Nice and comfortable. | The tea makes me feel warm. |
| hungry | Wanting to eat food. | I am hungry at lunchtime. |
| heat | To make something hot. | Mom heats water in a pot. |
| pot | A round metal container for cooking. | The soup is in the pot. |
| nap | A short sleep in the day. | My little brother takes a nap after lunch. |
| soup | A hot liquid food with vegetables or meat. | Chicken soup is delicious. |
| lemon tea | A hot drink made with tea and lemon. | Lemon tea is good when I feel cold. |
| chicken, carrots, onions | Food for soup. A bird meat, an orange vegetable, and a round vegetable with layers. | Soup has chicken, carrots, and onions. |
Please create colorful pdf to download.
cd /tmp/workspace/esl && python3 -c " import pdfplumber from PIL import Image with pdfplumber.open('/tmp/workspace/attachments/8ca4e69d-0b9d-43f8-a1c5-f938f37bccc1/DOC-20261101-WA0008.pdf') as pdf: pdf.pages[0].to_image(resolution=144).save('hi1.png') im=Image.open('hi1.png'); print(im.size) W,H=im.size sx=W/1690; sy=H/2184 cols=[(157,577),(643,1063),(1131,1551)]; rows=[(445,700),(770,1025),(1094,1350)] names=['cream','sugar','salt','pour','plastic_bags','mixture','open','closed','freezer'] k=0 for r in rows: for c in cols: im.crop((int((c[0]+8)*sx),int((r[0]+8)*sy),int((c[1]-8)*sx),int((r[1]-8)*sy))).save(names[k]+'.png'); k+=1 print(Image.open('cream.png').size) "; ls
~/esl/make_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm
from reportlab.pdfgen import canvas
from reportlab.platypus import (BaseDocTemplate, PageTemplate, Frame, Paragraph, Spacer,
Table, TableStyle, PageBreak, Image, KeepTogether, Flowable)
from reportlab.lib.styles import ParagraphStyle
from reportlab.lib.enums import TA_CENTER
W, H = A4
OUT = "/tmp/workspace/esl/Unit4_Foods_and_Mixtures_ESL_Speaking_Practice.pdf"
TEAL = colors.HexColor("#2A9DB5")
ORANGE = colors.HexColor("#F59E0B")
PINK = colors.HexColor("#EC4899")
GREEN = colors.HexColor("#22A06B")
PURPLE = colors.HexColor("#7C5CD6")
RED = colors.HexColor("#EF5B4D")
BLUE = colors.HexColor("#3B82F6")
CREAM = colors.HexColor("#FFF8E7")
DARK = colors.HexColor("#243447")
def S(name, **kw):
base = dict(fontName="Helvetica", fontSize=11, leading=15, textColor=DARK)
base.update(kw)
return ParagraphStyle(name, **base)
body = S("body")
small = S("small", fontSize=10, leading=13)
word = S("word", fontName="Helvetica-Bold", fontSize=13, leading=16, textColor=colors.white, alignment=TA_CENTER)
cell = S("cell", fontSize=10.5, leading=13.5)
cellb = S("cellb", fontName="Helvetica-Bold", fontSize=11.5, leading=14, textColor=DARK)
qs = S("qs", fontName="Helvetica-Bold", fontSize=11.5, leading=15, textColor=DARK)
ans = S("ans", fontSize=11, leading=14.5, textColor=colors.HexColor("#14532D"))
tip = S("tip", fontSize=10.5, leading=14)
title = S("title", fontName="Helvetica-Bold", fontSize=34, leading=40, textColor=colors.white, alignment=TA_CENTER)
sub = S("sub", fontName="Helvetica", fontSize=16, leading=22, textColor=colors.white, alignment=TA_CENTER)
# ---------- page decorations ----------
def draw_dots(c, color, y):
c.setFillColor(color)
x = 15 * mm
while x < W - 10 * mm:
c.circle(x, y, 1.6, stroke=0, fill=1)
x += 6 * mm
def page_deco(c, doc):
c.saveState()
c.setFillColor(TEAL); c.rect(0, H - 14 * mm, W, 14 * mm, stroke=0, fill=1)
c.setFillColor(ORANGE); c.rect(0, H - 16 * mm, W, 2 * mm, stroke=0, fill=1)
c.setFillColor(colors.white); c.setFont("Helvetica-Bold", 10)
c.drawString(15 * mm, H - 9 * mm, "UNIT 4 | Foods and Mixtures | ESL Speaking Practice")
c.setFillColor(PINK); c.rect(0, 0, W, 9 * mm, stroke=0, fill=1)
c.setFillColor(colors.white); c.setFont("Helvetica-Bold", 9)
c.drawCentredString(W / 2, 3.2 * mm, "Page %d" % doc.page)
for i, col in enumerate([RED, ORANGE, GREEN, BLUE, PURPLE]):
c.setFillColor(col); c.circle(W - 15 * mm - i * 6 * mm, H - 9 * mm + 0.5, 2, stroke=0, fill=1)
c.restoreState()
def cover_deco(c, doc):
c.saveState()
c.setFillColor(TEAL); c.rect(0, 0, W, H, stroke=0, fill=1)
c.setFillColor(colors.HexColor("#38B2CB")); c.circle(W - 20 * mm, H - 30 * mm, 70 * mm, stroke=0, fill=1)
c.setFillColor(ORANGE); c.circle(15 * mm, 40 * mm, 45 * mm, stroke=0, fill=1)
c.setFillColor(PINK); c.circle(W - 30 * mm, 25 * mm, 30 * mm, stroke=0, fill=1)
c.setFillColor(GREEN); c.circle(40 * mm, H - 60 * mm, 18 * mm, stroke=0, fill=1)
c.setFillColor(PURPLE); c.circle(W - 45 * mm, H - 120 * mm, 12 * mm, stroke=0, fill=1)
c.setFillColor(RED); c.circle(30 * mm, H - 130 * mm, 8 * mm, stroke=0, fill=1)
c.restoreState()
class Banner(Flowable):
def __init__(self, text, color, width=None):
super().__init__()
self.text, self.color, self.w = text, color, width or (W - 30 * mm)
self.height = 11 * mm
def wrap(self, aw, ah):
return self.w, self.height
def draw(self):
c = self.canv
c.setFillColor(self.color)
c.roundRect(0, 0, self.w, self.height, 5 * mm, stroke=0, fill=1)
c.setFillColor(colors.white); c.setFont("Helvetica-Bold", 15)
c.drawString(6 * mm, 3.4 * mm, self.text)
class QCard(Flowable):
"""Numbered colored question card with answer."""
def __init__(self, n, q, a, color, tense):
super().__init__()
self.n, self.q, self.a, self.color, self.tense = n, q, a, color, tense
self.w = W - 30 * mm
self.qp = Paragraph(q, qs)
self.ap = Paragraph("<b>Answer:</b> " + a, ans)
def wrap(self, aw, ah):
tw = self.w - 22 * mm
self.qh = self.qp.wrap(tw, 1000)[1]
self.ah = self.ap.wrap(tw - 6 * mm, 1000)[1]
self.height = self.qh + self.ah + 14 * mm
return self.w, self.height
def draw(self):
c = self.canv
h = self.height
c.setFillColor(colors.white); c.setStrokeColor(self.color); c.setLineWidth(1.6)
c.roundRect(0, 0, self.w, h, 4 * mm, stroke=1, fill=1)
# number badge
c.setFillColor(self.color); c.circle(9 * mm, h - 9 * mm, 6 * mm, stroke=0, fill=1)
c.setFillColor(colors.white); c.setFont("Helvetica-Bold", 13)
c.drawCentredString(9 * mm, h - 11.2 * mm, str(self.n))
# question
self.qp.drawOn(c, 19 * mm, h - 5 * mm - self.qh)
# tense tag
c.setFillColor(self.color); c.setFont("Helvetica-Bold", 7.5)
# answer box
ay = 3 * mm
c.setFillColor(colors.HexColor("#E8F8EE"))
c.roundRect(19 * mm, ay, self.w - 22 * mm, self.ah + 4 * mm, 2.5 * mm, stroke=0, fill=1)
self.ap.drawOn(c, 22 * mm, ay + 2 * mm)
# ---------- content ----------
pics = [("cream", "cream", ORANGE), ("sugar", "sugar", RED), ("salt", "salt", GREEN),
("pour", "pour", PURPLE), ("plastic_bags", "plastic bags", BLUE), ("mixture", "mixture", PINK),
("open", "open", ORANGE), ("closed", "closed", TEAL), ("freezer", "freezer", RED)]
means = {
"cream": "A thick, white liquid from milk.",
"sugar": "A sweet, white food.",
"salt": "A white powder that makes food salty.",
"pour": "To make a liquid go into something.",
"plastic bags": "Thin, clear bags to keep things.",
"mixture": "Two or more things put together.",
"open": "Not shut. You can go in or see through.",
"closed": "Shut. You cannot go in.",
"freezer": "A very cold box that keeps food frozen.",
}
def pic_card(fn, label, color):
img = Image("/tmp/workspace/esl/%s.png" % fn, width=52 * mm, height=30.7 * mm)
t = Table([[img], [Paragraph(label, word)], [Paragraph(means[label], S("m", fontSize=9.5, leading=12, textColor=colors.white, alignment=TA_CENTER))]],
colWidths=[56 * mm])
t.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, -1), color),
("ALIGN", (0, 0), (-1, -1), "CENTER"),
("VALIGN", (0, 0), (-1, -1), "MIDDLE"),
("TOPPADDING", (0, 0), (0, 0), 3), ("BOTTOMPADDING", (0, 0), (0, 0), 2),
("BOTTOMPADDING", (0, 2), (0, 2), 7),
("ROUNDEDCORNERS", [8, 8, 8, 8]),
]))
return t
vocab2 = [
("cause", "The reason why something happens.", "The cause is: I am cold."),
("effect", "What happens after the cause.", "The effect is: I drink hot tea."),
("ice cream", "A cold, sweet food.", "Ice cream is cold and sweet."),
("party", "A fun time with friends, food, and games.", "We have a party on Saturday."),
("play", "A story that actors act on a stage.", "Our class is in a play."),
("stage", "The place where actors act.", "The actors stand on the stage."),
("actor", "A person who acts in a play.", "The actor is very funny."),
("feel awful", "To feel very bad or sick.", "I feel awful when I am sick."),
("cold", "Not warm. Low temperature.", "The freezer is very cold."),
("warm", "A little hot. Nice and comfortable.", "The tea makes me feel warm."),
("hungry", "Wanting to eat food.", "I am hungry at lunchtime."),
("heat", "To make something hot.", "Mom heats water in a pot."),
("pot", "A round metal container for cooking.", "The soup is in the pot."),
("nap", "A short sleep in the day.", "My brother takes a nap after lunch."),
("soup", "A hot liquid food with vegetables or meat.", "Chicken soup is delicious."),
("lemon tea", "A hot drink made with tea and lemon.", "Lemon tea is good when I feel cold."),
("chicken, carrots, onions", "Chicken is bird meat. Carrots are orange vegetables. Onions are round vegetables with layers.", "Soup has chicken, carrots, and onions."),
]
story = []
# Cover
story += [Spacer(1, 62 * mm), Paragraph("UNIT 4", S("u", fontName="Helvetica-Bold", fontSize=22, textColor=colors.HexColor("#FFE08A"), alignment=TA_CENTER)),
Spacer(1, 4 * mm),
Paragraph("Foods and Mixtures", title),
Spacer(1, 6 * mm),
Paragraph("Vocabulary Words<br/>+ 15 Speaking Practice Questions", sub),
Spacer(1, 10 * mm),
Paragraph("Grade 4 ESL | Cambridge Speaking Practice", S("s2", fontName="Helvetica-Bold", fontSize=13, textColor=colors.white, alignment=TA_CENTER)),
Spacer(1, 6 * mm),
Paragraph("Tenses used: Present Simple, Present Continuous, Future Simple (will)", S("s3", fontSize=11, textColor=colors.HexColor("#E0F7FB"), alignment=TA_CENTER)),
PageBreak()]
# Vocab part 1
story += [Spacer(1, 4 * mm), Banner("Part 1A: Picture Words", ORANGE), Spacer(1, 3 * mm),
Paragraph("Look at the pictures. Point, listen, and say each word out loud.", body), Spacer(1, 4 * mm)]
rows = []
for i in range(0, 9, 3):
rows.append([pic_card(*pics[j]) for j in range(i, i + 3)])
grid = Table(rows, colWidths=[60 * mm] * 3, rowHeights=[None] * 3)
grid.setStyle(TableStyle([("ALIGN", (0, 0), (-1, -1), "CENTER"), ("VALIGN", (0, 0), (-1, -1), "TOP"),
("BOTTOMPADDING", (0, 0), (-1, -1), 6)]))
story += [grid, PageBreak()]
# Vocab part 2
story += [Spacer(1, 4 * mm), Banner("Part 1B: Story Words", PURPLE), Spacer(1, 2 * mm),
Paragraph("From the reading: <b>Let's Make Ice Cream!</b>", body), Spacer(1, 3 * mm)]
data = [[Paragraph("<font color='white'><b>Word</b></font>", cell), Paragraph("<font color='white'><b>Meaning</b></font>", cell),
Paragraph("<font color='white'><b>Example sentence</b></font>", cell)]]
for w, m, e in vocab2:
data.append([Paragraph(w, cellb), Paragraph(m, cell), Paragraph(e, cell)])
t = Table(data, colWidths=[38 * mm, 70 * mm, 72 * mm], repeatRows=1)
rowcols = [colors.HexColor("#F3EEFF"), colors.HexColor("#FFF4DA"), colors.HexColor("#E6F6FA"), colors.HexColor("#FFE9F2")]
style = [("BACKGROUND", (0, 0), (-1, 0), PURPLE), ("VALIGN", (0, 0), (-1, -1), "MIDDLE"),
("TOPPADDING", (0, 0), (-1, -1), 4), ("BOTTOMPADDING", (0, 0), (-1, -1), 4),
("LEFTPADDING", (0, 0), (-1, -1), 6), ("LINEBELOW", (0, 0), (-1, -1), 0.6, colors.white)]
for i in range(1, len(data)):
style.append(("BACKGROUND", (0, i), (-1, i), rowcols[(i - 1) % 4]))
t.setStyle(TableStyle(style))
story += [t, PageBreak()]
# Questions
Q = [
("Do you like ice cream? Why or why not?", "Yes, I do. I like ice cream because it is cold and sweet.", ORANGE),
("Where do you keep ice cream at home?", "I keep ice cream in the freezer. The freezer is very cold.", ORANGE),
("What do you put in your tea or hot chocolate?", "I put sugar and cream in my hot chocolate. They make it sweet.", ORANGE),
("What do you put salt on?", "I put salt on my eggs and my french fries.", ORANGE),
("What do you do when you are hungry?", "When I am hungry, I eat a sandwich or some soup.", ORANGE),
("Look at the picture of the orange juice. What is the person doing?", "The person is pouring orange juice into a glass.", TEAL),
("Look at the picture of the bowl. What is the person making?", "The person is making a mixture. I think it is cookie mixture, and the person is stirring it.", TEAL),
("Look at Omar in the picture. What is he doing? How does he feel?", "Omar is holding a cup of hot lemon tea. He is feeling warm now.", TEAL),
("Look at the two windows. Which window is open? Which window is closed?", "The left window is open. The right window is closed.", TEAL),
("What is your mom or dad doing in the kitchen right now?", "My mom is heating water in a pot. She is making soup.", TEAL),
("If you are really cold, what will your mother do?", "My mother will make me hot tea. Then I will feel warm.", PURPLE),
("What happens when Omar drinks the hot tea?", "Omar feels warm. He will take a nap after that.", PURPLE),
("What does Omar's mother put in the soup?", "She puts chicken, carrots, and onions in the soup. Omar will eat it and feel good.", PURPLE),
("What will you make for a party with your friends?", "I will make ice cream and a milkshake. I will pour the milk into the mixture.", PINK),
("What will you eat for dinner tonight?", "I will eat chicken soup with carrots and onions. It will be delicious.", PINK),
]
sections = [
(0, 5, "Section A: Warm-up (Present Simple)", ORANGE, "Answer about your daily life and your likes."),
(5, 10, "Section B: Picture Talk (Present Continuous)", TEAL, "Look at the picture and say what is happening now."),
(10, 13, "Section C: Cause and Effect (Present Simple + will)", PURPLE, "A cause is why something happens. An effect is what happens next."),
(13, 15, "Section D: Future Plans (Future Simple)", PINK, "Talk about your plans. Use will."),
]
story += [Spacer(1, 4 * mm), Banner("Part 2: Speaking Questions and Model Answers", GREEN), Spacer(1, 3 * mm)]
first = True
for a, b, name, col, inst in sections:
block = [Banner(name, col, W - 30 * mm), Spacer(1, 1.5 * mm), Paragraph(inst, small), Spacer(1, 2 * mm)]
story.append(KeepTogether(block + [QCard(a + 1, Q[a][0], Q[a][1], col, ""), Spacer(1, 3 * mm)]))
for i in range(a + 1, b):
story += [QCard(i + 1, Q[i][0], Q[i][1], col, ""), Spacer(1, 3 * mm)]
story.append(Spacer(1, 3 * mm))
# Tips
tips = [
"Point to the pictures on Part 1A while answering. This matches the Cambridge picture style.",
"If the answer is only one word, ask: <b>Why?</b> or <b>Tell me more.</b>",
"Sentence starters: <b>I put ... in ...</b> | <b>He is ... now.</b> | <b>I will ... because ...</b>",
"Cause and effect game: the teacher says the cause, the student gives the effect.",
]
tipdata = [[Paragraph("<font color='white'><b>Teacher and Parent Tips</b></font>", S("t", fontSize=13, leading=16))]]
for x in tips:
tipdata.append([Paragraph("* " + x, tip)])
tt = Table(tipdata, colWidths=[W - 30 * mm])
tt.setStyle(TableStyle([("BACKGROUND", (0, 0), (-1, 0), RED), ("BACKGROUND", (0, 1), (-1, -1), CREAM),
("BOX", (0, 0), (-1, -1), 1.5, RED), ("LEFTPADDING", (0, 0), (-1, -1), 8),
("TOPPADDING", (0, 0), (-1, -1), 5), ("BOTTOMPADDING", (0, 0), (-1, -1), 5)]))
story.append(KeepTogether([tt]))
doc = BaseDocTemplate(OUT, pagesize=A4, title="Unit 4 Foods and Mixtures - ESL Speaking Practice",
author="Orris", leftMargin=15 * mm, rightMargin=15 * mm, topMargin=22 * mm, bottomMargin=15 * mm)
fr = Frame(15 * mm, 13 * mm, W - 30 * mm, H - 36 * mm, id="f", leftPadding=0, rightPadding=0, topPadding=0, bottomPadding=0)
doc.addPageTemplates([PageTemplate(id="cover", frames=[fr], onPage=cover_deco, autoNextPageTemplate="main"),
PageTemplate(id="main", frames=[fr], onPage=page_deco)])
doc.build(story)
print("ok")
cd /tmp/workspace/esl && python3 make_pdf.py && python3 -c " import pdfplumber with pdfplumber.open('Unit4_Foods_and_Mixtures_ESL_Speaking_Practice.pdf') as pdf: print(len(pdf.pages)) for i,p in enumerate(pdf.pages): p.to_image(resolution=60).save(f'prev{i+1}.png') "
Unit4 Foods and Mixtures ESL Speaking Practice
PDF Document · PDF
Please recreate the colorful handbook with Russian translation under every sentences.
fc-list 2>/dev/null | grep -iE "dejavu|liberation|noto|arial|roboto|open" | head -20; python3 -c "import matplotlib,os;print(os.path.join(os.path.dirname(matplotlib.__file__),'mpl-data/fonts/ttf'))"; ls $(python3 -c "import matplotlib,os;print(os.path.join(os.path.dirname(matplotlib.__file__),'mpl-data/fonts/ttf'))") | grep -i dejavu
cd /tmp/workspace/esl && python3 - <<'EOF' import re src = open('make_pdf.py').read() print(len(src)) EOF
~/esl/make_pdf_ru.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.platypus import (BaseDocTemplate, PageTemplate, Frame, Paragraph, Spacer,
Table, TableStyle, PageBreak, Image, KeepTogether, Flowable)
from reportlab.lib.styles import ParagraphStyle
from reportlab.lib.enums import TA_CENTER
from reportlab.lib.fonts import addMapping
FD = "/opt/amazon/genesis1p-tools/venv/lib64/python3.12/site-packages/matplotlib/mpl-data/fonts/ttf/"
pdfmetrics.registerFont(TTFont("DV", FD + "DejaVuSans.ttf"))
pdfmetrics.registerFont(TTFont("DV-B", FD + "DejaVuSans-Bold.ttf"))
pdfmetrics.registerFont(TTFont("DV-I", FD + "DejaVuSans-Oblique.ttf"))
pdfmetrics.registerFont(TTFont("DV-BI", FD + "DejaVuSans-BoldOblique.ttf"))
addMapping("DV", 0, 0, "DV"); addMapping("DV", 1, 0, "DV-B")
addMapping("DV", 0, 1, "DV-I"); addMapping("DV", 1, 1, "DV-BI")
W, H = A4
OUT = "/tmp/workspace/esl/Unit4_Foods_and_Mixtures_ESL_Speaking_Practice_RU.pdf"
TEAL = colors.HexColor("#2A9DB5"); ORANGE = colors.HexColor("#F59E0B")
PINK = colors.HexColor("#EC4899"); GREEN = colors.HexColor("#22A06B")
PURPLE = colors.HexColor("#7C5CD6"); RED = colors.HexColor("#EF5B4D")
BLUE = colors.HexColor("#3B82F6"); CREAM = colors.HexColor("#FFF8E7")
DARK = colors.HexColor("#243447"); RUC = colors.HexColor("#B4235A")
def S(name, **kw):
base = dict(fontName="DV", fontSize=10, leading=13.5, textColor=DARK)
base.update(kw)
return ParagraphStyle(name, **base)
body = S("body", fontSize=10.5, leading=14)
body_ru = S("body_ru", fontSize=9.5, leading=13, textColor=RUC)
cell = S("cell", fontSize=9, leading=12)
cell_ru = S("cell_ru", fontSize=8.5, leading=11.5, textColor=RUC)
cellb = S("cellb", fontName="DV-B", fontSize=10, leading=13)
cellb_ru = S("cellb_ru", fontName="DV-B", fontSize=9.5, leading=12, textColor=RUC)
qs = S("qs", fontName="DV-B", fontSize=10.5, leading=14)
qs_ru = S("qs_ru", fontSize=9.5, leading=13, textColor=RUC)
ans = S("ans", fontSize=10, leading=13.5, textColor=colors.HexColor("#14532D"))
ans_ru = S("ans_ru", fontSize=9.2, leading=12.5, textColor=RUC)
tip = S("tip", fontSize=9.5, leading=13)
tip_ru = S("tip_ru", fontSize=9, leading=12, textColor=RUC)
title = S("title", fontName="DV-B", fontSize=32, leading=38, textColor=colors.white, alignment=TA_CENTER)
sub = S("sub", fontSize=15, leading=20, textColor=colors.white, alignment=TA_CENTER)
sub_ru = S("sub_ru", fontSize=12, leading=16, textColor=colors.HexColor("#FFE08A"), alignment=TA_CENTER)
cw = S("cw", fontName="DV-B", fontSize=12.5, leading=15, textColor=colors.white, alignment=TA_CENTER)
cw_ru = S("cw_ru", fontName="DV-B", fontSize=11, leading=13, textColor=colors.HexColor("#FFE08A"), alignment=TA_CENTER)
cm = S("cm", fontSize=8, leading=10.5, textColor=colors.white, alignment=TA_CENTER)
cm_ru = S("cm_ru", fontSize=8, leading=10.5, textColor=colors.HexColor("#FFF3C4"), alignment=TA_CENTER)
def page_deco(c, doc):
c.saveState()
c.setFillColor(TEAL); c.rect(0, H - 14 * mm, W, 14 * mm, stroke=0, fill=1)
c.setFillColor(ORANGE); c.rect(0, H - 16 * mm, W, 2 * mm, stroke=0, fill=1)
c.setFillColor(colors.white); c.setFont("DV-B", 9)
c.drawString(15 * mm, H - 9 * mm, "UNIT 4 | Foods and Mixtures | ESL Speaking Practice")
c.setFillColor(PINK); c.rect(0, 0, W, 9 * mm, stroke=0, fill=1)
c.setFillColor(colors.white); c.setFont("DV-B", 8.5)
c.drawCentredString(W / 2, 3.2 * mm, "Page / Стр. %d" % doc.page)
for i, col in enumerate([RED, ORANGE, GREEN, BLUE, PURPLE]):
c.setFillColor(col); c.circle(W - 15 * mm - i * 6 * mm, H - 9 * mm + 0.5, 2, stroke=0, fill=1)
c.restoreState()
def cover_deco(c, doc):
c.saveState()
c.setFillColor(TEAL); c.rect(0, 0, W, H, stroke=0, fill=1)
c.setFillColor(colors.HexColor("#38B2CB")); c.circle(W - 20 * mm, H - 30 * mm, 70 * mm, stroke=0, fill=1)
c.setFillColor(ORANGE); c.circle(15 * mm, 40 * mm, 45 * mm, stroke=0, fill=1)
c.setFillColor(PINK); c.circle(W - 30 * mm, 25 * mm, 30 * mm, stroke=0, fill=1)
c.setFillColor(GREEN); c.circle(40 * mm, H - 60 * mm, 18 * mm, stroke=0, fill=1)
c.setFillColor(PURPLE); c.circle(W - 45 * mm, H - 120 * mm, 12 * mm, stroke=0, fill=1)
c.setFillColor(RED); c.circle(30 * mm, H - 130 * mm, 8 * mm, stroke=0, fill=1)
c.restoreState()
class Banner(Flowable):
def __init__(self, en, ru, color):
super().__init__()
self.en, self.ru, self.color = en, ru, color
self.w = W - 30 * mm; self.height = 14 * mm
def wrap(self, aw, ah):
return self.w, self.height
def draw(self):
c = self.canv
c.setFillColor(self.color)
c.roundRect(0, 0, self.w, self.height, 5 * mm, stroke=0, fill=1)
c.setFillColor(colors.white); c.setFont("DV-B", 13)
c.drawString(6 * mm, 7.2 * mm, self.en)
c.setFillColor(colors.HexColor("#FFF3C4")); c.setFont("DV", 9.5)
c.drawString(6 * mm, 2.4 * mm, self.ru)
class QCard(Flowable):
def __init__(self, n, q, qru, a, aru, color):
super().__init__()
self.n, self.color = n, color
self.w = W - 30 * mm
self.qp = Paragraph(q, qs); self.qrp = Paragraph(qru, qs_ru)
self.ap = Paragraph("<b>Answer:</b> " + a, ans)
self.arp = Paragraph("<b>Ответ:</b> " + aru, ans_ru)
def wrap(self, aw, ah):
tw = self.w - 22 * mm
self.qh = self.qp.wrap(tw, 1000)[1]
self.qrh = self.qrp.wrap(tw, 1000)[1]
iw = tw - 6 * mm
self.ah = self.ap.wrap(iw, 1000)[1]
self.arh = self.arp.wrap(iw, 1000)[1]
self.box = self.ah + self.arh + 5 * mm
self.height = self.qh + self.qrh + self.box + 11 * mm
return self.w, self.height
def draw(self):
c = self.canv; h = self.height
c.setFillColor(colors.white); c.setStrokeColor(self.color); c.setLineWidth(1.6)
c.roundRect(0, 0, self.w, h, 4 * mm, stroke=1, fill=1)
c.setFillColor(self.color); c.circle(9 * mm, h - 9 * mm, 6 * mm, stroke=0, fill=1)
c.setFillColor(colors.white); c.setFont("DV-B", 12)
c.drawCentredString(9 * mm, h - 10.8 * mm, str(self.n))
y = h - 4 * mm - self.qh
self.qp.drawOn(c, 19 * mm, y)
y -= self.qrh + 0.5 * mm
self.qrp.drawOn(c, 19 * mm, y)
by = 3 * mm
c.setFillColor(colors.HexColor("#E8F8EE"))
c.roundRect(19 * mm, by, self.w - 22 * mm, self.box, 2.5 * mm, stroke=0, fill=1)
self.arp.drawOn(c, 22 * mm, by + 2 * mm)
self.ap.drawOn(c, 22 * mm, by + 2 * mm + self.arh + 1 * mm)
# ---------- picture words ----------
pics = [
("cream", "cream", "сливки", "A thick, white liquid from milk.", "Густая белая жидкость из молока.", ORANGE),
("sugar", "sugar", "сахар", "A sweet, white food.", "Сладкая белая еда.", RED),
("salt", "salt", "соль", "A white powder that makes food salty.", "Белый порошок, который делает еду солёной.", GREEN),
("pour", "pour", "лить, наливать", "To make a liquid go into something.", "Сделать так, чтобы жидкость перетекла во что-то.", PURPLE),
("plastic_bags", "plastic bags", "пластиковые пакеты", "Thin, clear bags to keep things.", "Тонкие прозрачные пакеты, чтобы хранить вещи.", BLUE),
("mixture", "mixture", "смесь", "Two or more things put together.", "Две или больше вещей, смешанные вместе.", PINK),
("open", "open", "открытый", "Not shut. You can go in or see through.", "Не закрыто. Можно войти или смотреть насквозь.", ORANGE),
("closed", "closed", "закрытый", "Shut. You cannot go in.", "Закрыто. Нельзя войти.", TEAL),
("freezer", "freezer", "морозильник", "A very cold box that keeps food frozen.", "Очень холодный ящик, где еда замораживается.", RED),
]
def pic_card(fn, en, ru, men, mru, color):
img = Image("/tmp/workspace/esl/%s.png" % fn, width=52 * mm, height=30.7 * mm)
t = Table([[img], [Paragraph(en, cw)], [Paragraph(ru, cw_ru)], [Paragraph(men, cm)], [Paragraph(mru, cm_ru)]],
colWidths=[56 * mm])
t.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, -1), color), ("ALIGN", (0, 0), (-1, -1), "CENTER"),
("VALIGN", (0, 0), (-1, -1), "MIDDLE"),
("TOPPADDING", (0, 0), (-1, -1), 1), ("BOTTOMPADDING", (0, 0), (-1, -1), 1),
("TOPPADDING", (0, 0), (0, 0), 3), ("BOTTOMPADDING", (0, 0), (0, 0), 3),
("BOTTOMPADDING", (0, 4), (0, 4), 7), ("LEFTPADDING", (0, 3), (0, 4), 4), ("RIGHTPADDING", (0, 3), (0, 4), 4),
]))
return t
# (word, word_ru, meaning, meaning_ru, example, example_ru)
ex_pics = [
("cream", "сливки", "A thick, white liquid from milk.", "Густая белая жидкость из молока.", "I put cream in my hot chocolate.", "Я добавляю сливки в горячий шоколад."),
("sugar", "сахар", "A sweet, white food.", "Сладкая белая еда.", "Sugar makes tea sweet.", "Сахар делает чай сладким."),
("salt", "соль", "A white powder that makes food salty.", "Белый порошок, который делает еду солёной.", "My dad puts salt on his eggs.", "Мой папа посыпает яйца солью."),
("pour", "лить, наливать", "To make a liquid go into something.", "Сделать так, чтобы жидкость перетекла во что-то.", "I pour juice into my glass.", "Я наливаю сок в свой стакан."),
("plastic bags", "пластиковые пакеты", "Thin, clear bags to keep things.", "Тонкие прозрачные пакеты, чтобы хранить вещи.", "Mom puts sandwiches in plastic bags.", "Мама кладёт бутерброды в пластиковые пакеты."),
("mixture", "смесь", "Two or more things put together.", "Две или больше вещей, смешанные вместе.", "The cookie mixture is in the bowl.", "Смесь для печенья в миске."),
("open", "открытый", "Not shut. You can go in or see through.", "Не закрыто. Можно войти или смотреть насквозь.", "The door is open.", "Дверь открыта."),
("closed", "закрытый", "Shut. You cannot go in.", "Закрыто. Нельзя войти.", "The window is closed.", "Окно закрыто."),
("freezer", "морозильник", "A very cold box that keeps food frozen.", "Очень холодный ящик, где еда замораживается.", "Ice cream stays in the freezer.", "Мороженое лежит в морозильнике."),
]
vocab2 = [
("cause", "причина", "The reason why something happens.", "Причина, по которой что-то происходит.", "The cause is: I am cold.", "Причина: мне холодно."),
("effect", "следствие, результат", "What happens after the cause.", "То, что происходит после причины.", "The effect is: I drink hot tea.", "Следствие: я пью горячий чай."),
("ice cream", "мороженое", "A cold, sweet food.", "Холодная сладкая еда.", "Ice cream is cold and sweet.", "Мороженое холодное и сладкое."),
("party", "вечеринка", "A fun time with friends, food, and games.", "Весёлое время с друзьями, едой и играми.", "We have a party on Saturday.", "У нас вечеринка в субботу."),
("play", "пьеса, спектакль", "A story that actors act on a stage.", "История, которую актёры играют на сцене.", "Our class is in a play.", "Наш класс участвует в спектакле."),
("stage", "сцена", "The place where actors act.", "Место, где играют актёры.", "The actors stand on the stage.", "Актёры стоят на сцене."),
("actor", "актёр", "A person who acts in a play.", "Человек, который играет в спектакле.", "The actor is very funny.", "Актёр очень смешной."),
("feel awful", "чувствовать себя ужасно", "To feel very bad or sick.", "Чувствовать себя очень плохо или болеть.", "I feel awful when I am sick.", "Я чувствую себя ужасно, когда болею."),
("cold", "холодный", "Not warm. Low temperature.", "Не тёплый. Низкая температура.", "The freezer is very cold.", "Морозильник очень холодный."),
("warm", "тёплый", "A little hot. Nice and comfortable.", "Немного горячий. Приятный и уютный.", "The tea makes me feel warm.", "Чай согревает меня."),
("hungry", "голодный", "Wanting to eat food.", "Хотеть есть.", "I am hungry at lunchtime.", "Я голоден во время обеда."),
("heat", "нагревать", "To make something hot.", "Сделать что-то горячим.", "Mom heats water in a pot.", "Мама греет воду в кастрюле."),
("pot", "кастрюля", "A round metal container for cooking.", "Круглая металлическая ёмкость для готовки.", "The soup is in the pot.", "Суп в кастрюле."),
("nap", "короткий дневной сон", "A short sleep in the day.", "Короткий сон днём.", "My brother takes a nap after lunch.", "Мой брат спит днём после обеда."),
("soup", "суп", "A hot liquid food with vegetables or meat.", "Горячее жидкое блюдо с овощами или мясом.", "Chicken soup is delicious.", "Куриный суп очень вкусный."),
("lemon tea", "чай с лимоном", "A hot drink made with tea and lemon.", "Горячий напиток из чая и лимона.", "Lemon tea is good when I feel cold.", "Чай с лимоном хорош, когда мне холодно."),
("chicken, carrots, onions", "курица, морковь, лук",
"Chicken is bird meat. Carrots are orange vegetables. Onions are round vegetables with layers.",
"Курица: мясо птицы. Морковь: оранжевые овощи. Лук: круглые овощи со слоями.",
"Soup has chicken, carrots, and onions.", "В супе курица, морковь и лук."),
]
def vtable(rows, head_color, tints):
hs = S("hs", fontName="DV-B", fontSize=9.5, leading=12, textColor=colors.white)
data = [[Paragraph("Word / Слово", hs), Paragraph("Meaning / Значение", hs), Paragraph("Example / Пример", hs)]]
for w, wru, m, mru, e, eru in rows:
data.append([[Paragraph(w, cellb), Paragraph(wru, cellb_ru)],
[Paragraph(m, cell), Paragraph(mru, cell_ru)],
[Paragraph(e, cell), Paragraph(eru, cell_ru)]])
t = Table(data, colWidths=[36 * mm, 70 * mm, 74 * mm], repeatRows=1)
st = [("BACKGROUND", (0, 0), (-1, 0), head_color), ("VALIGN", (0, 0), (-1, -1), "MIDDLE"),
("TOPPADDING", (0, 0), (-1, -1), 3.5), ("BOTTOMPADDING", (0, 0), (-1, -1), 3.5),
("LEFTPADDING", (0, 0), (-1, -1), 5), ("LINEBELOW", (0, 0), (-1, -1), 0.6, colors.white)]
for i in range(1, len(data)):
st.append(("BACKGROUND", (0, i), (-1, i), tints[(i - 1) % len(tints)]))
t.setStyle(TableStyle(st))
return t
story = []
# Cover
story += [Spacer(1, 58 * mm),
Paragraph("UNIT 4", S("u", fontName="DV-B", fontSize=22, textColor=colors.HexColor("#FFE08A"), alignment=TA_CENTER)),
Spacer(1, 4 * mm), Paragraph("Foods and Mixtures", title),
Paragraph("Еда и смеси", S("t2", fontName="DV-B", fontSize=20, leading=26, textColor=colors.HexColor("#FFE08A"), alignment=TA_CENTER)),
Spacer(1, 7 * mm),
Paragraph("Vocabulary Words + 15 Speaking Practice Questions", sub),
Paragraph("Словарь и 15 вопросов для разговорной практики", sub_ru),
Spacer(1, 9 * mm),
Paragraph("Grade 4 ESL | Cambridge Speaking Practice", S("s2", fontName="DV-B", fontSize=12, textColor=colors.white, alignment=TA_CENTER)),
Paragraph("4 класс, английский как второй язык | Подготовка к устной части Cambridge", S("s2r", fontSize=10, textColor=colors.HexColor("#FFE08A"), alignment=TA_CENTER)),
Spacer(1, 6 * mm),
Paragraph("Tenses used: Present Simple, Present Continuous, Future Simple (will)", S("s3", fontSize=10, textColor=colors.HexColor("#E0F7FB"), alignment=TA_CENTER)),
Paragraph("Времена: Present Simple, Present Continuous, Future Simple (will)", S("s3r", fontSize=9.5, textColor=colors.HexColor("#FFE08A"), alignment=TA_CENTER)),
PageBreak()]
# Part 1A
story += [Spacer(1, 4 * mm), Banner("Part 1A: Picture Words", "Часть 1A: Слова с картинками", ORANGE), Spacer(1, 3 * mm),
Paragraph("Look at the pictures. Point, listen, and say each word out loud.", body),
Paragraph("Посмотри на картинки. Покажи пальцем, послушай и скажи каждое слово вслух.", body_ru),
Spacer(1, 4 * mm)]
rows = [[pic_card(*pics[j]) for j in range(i, i + 3)] for i in range(0, 9, 3)]
grid = Table(rows, colWidths=[60 * mm] * 3)
grid.setStyle(TableStyle([("ALIGN", (0, 0), (-1, -1), "CENTER"), ("VALIGN", (0, 0), (-1, -1), "TOP"),
("BOTTOMPADDING", (0, 0), (-1, -1), 6)]))
story += [grid, PageBreak()]
# Part 1B
tints = [colors.HexColor("#FFF4DA"), colors.HexColor("#E6F6FA"), colors.HexColor("#FFE9F2"), colors.HexColor("#E8F8EE")]
story += [Spacer(1, 4 * mm), Banner("Part 1B: Example Sentences (Picture Words)", "Часть 1B: Примеры предложений (слова с картинками)", ORANGE),
Spacer(1, 3 * mm), vtable(ex_pics, ORANGE, tints), PageBreak()]
# Part 1C
tints2 = [colors.HexColor("#F3EEFF"), colors.HexColor("#FFF4DA"), colors.HexColor("#E6F6FA"), colors.HexColor("#FFE9F2")]
story += [Spacer(1, 4 * mm), Banner("Part 1C: Story Words", "Часть 1C: Слова из текста", PURPLE), Spacer(1, 2 * mm),
Paragraph("From the reading: <b>Let's Make Ice Cream!</b>", body),
Paragraph("Из текста: <b>«Давайте сделаем мороженое!»</b>", body_ru), Spacer(1, 3 * mm),
vtable(vocab2, PURPLE, tints2), PageBreak()]
# Questions
Q = [
("Do you like ice cream? Why or why not?", "Тебе нравится мороженое? Почему да или почему нет?",
"Yes, I do. I like ice cream because it is cold and sweet.", "Да, нравится. Мне нравится мороженое, потому что оно холодное и сладкое."),
("Where do you keep ice cream at home?", "Где ты хранишь мороженое дома?",
"I keep ice cream in the freezer. The freezer is very cold.", "Я храню мороженое в морозильнике. Морозильник очень холодный."),
("What do you put in your tea or hot chocolate?", "Что ты добавляешь в чай или горячий шоколад?",
"I put sugar and cream in my hot chocolate. They make it sweet.", "Я добавляю сахар и сливки в горячий шоколад. Они делают его сладким."),
("What do you put salt on?", "На что ты сыплешь соль?",
"I put salt on my eggs and my french fries.", "Я посыпаю солью яйца и картофель фри."),
("What do you do when you are hungry?", "Что ты делаешь, когда голоден?",
"When I am hungry, I eat a sandwich or some soup.", "Когда я голоден, я ем бутерброд или суп."),
("Look at the picture of the orange juice. What is the person doing?", "Посмотри на картинку с апельсиновым соком. Что делает человек?",
"The person is pouring orange juice into a glass.", "Человек наливает апельсиновый сок в стакан."),
("Look at the picture of the bowl. What is the person making?", "Посмотри на картинку с миской. Что готовит человек?",
"The person is making a mixture. I think it is cookie mixture, and the person is stirring it.", "Человек готовит смесь. Я думаю, это смесь для печенья, и человек её размешивает."),
("Look at Omar in the picture. What is he doing? How does he feel?", "Посмотри на Омара на картинке. Что он делает? Как он себя чувствует?",
"Omar is holding a cup of hot lemon tea. He is feeling warm now.", "Омар держит чашку горячего чая с лимоном. Сейчас ему тепло."),
("Look at the two windows. Which window is open? Which window is closed?", "Посмотри на два окна. Какое окно открыто? Какое окно закрыто?",
"The left window is open. The right window is closed.", "Левое окно открыто. Правое окно закрыто."),
("What is your mom or dad doing in the kitchen right now?", "Что сейчас делает на кухне твоя мама или папа?",
"My mom is heating water in a pot. She is making soup.", "Моя мама греет воду в кастрюле. Она готовит суп."),
("If you are really cold, what will your mother do?", "Если тебе очень холодно, что сделает твоя мама?",
"My mother will make me hot tea. Then I will feel warm.", "Моя мама приготовит мне горячий чай. Тогда мне станет тепло."),
("What happens when Omar drinks the hot tea?", "Что происходит, когда Омар пьёт горячий чай?",
"Omar feels warm. He will take a nap after that.", "Омару становится тепло. После этого он поспит."),
("What does Omar's mother put in the soup?", "Что мама Омара кладёт в суп?",
"She puts chicken, carrots, and onions in the soup. Omar will eat it and feel good.", "Она кладёт в суп курицу, морковь и лук. Омар съест его и почувствует себя хорошо."),
("What will you make for a party with your friends?", "Что ты приготовишь для вечеринки с друзьями?",
"I will make ice cream and a milkshake. I will pour the milk into the mixture.", "Я приготовлю мороженое и молочный коктейль. Я волью молоко в смесь."),
("What will you eat for dinner tonight?", "Что ты будешь есть на ужин сегодня вечером?",
"I will eat chicken soup with carrots and onions. It will be delicious.", "Я буду есть куриный суп с морковью и луком. Он будет вкусным."),
]
sections = [
(0, 5, "Section A: Warm-up (Present Simple)", "Раздел A: Разминка (Present Simple)", ORANGE,
"Answer about your daily life and your likes.", "Отвечай о своей повседневной жизни и о том, что тебе нравится."),
(5, 10, "Section B: Picture Talk (Present Continuous)", "Раздел B: Разговор по картинке (Present Continuous)", TEAL,
"Look at the picture and say what is happening now.", "Посмотри на картинку и скажи, что происходит сейчас."),
(10, 13, "Section C: Cause and Effect (Present Simple + will)", "Раздел C: Причина и следствие (Present Simple + will)", PURPLE,
"A cause is why something happens. An effect is what happens next.", "Причина: почему что-то происходит. Следствие: что происходит потом."),
(13, 15, "Section D: Future Plans (Future Simple)", "Раздел D: Планы на будущее (Future Simple)", PINK,
"Talk about your plans. Use will.", "Расскажи о своих планах. Используй will."),
]
story += [Spacer(1, 4 * mm), Banner("Part 2: Speaking Questions and Model Answers", "Часть 2: Вопросы для разговора и образцы ответов", GREEN), Spacer(1, 4 * mm)]
for a, b, en, ru, col, ien, iru in sections:
head = [Banner(en, ru, col), Spacer(1, 1.5 * mm), Paragraph(ien, body), Paragraph(iru, body_ru), Spacer(1, 2 * mm)]
story.append(KeepTogether(head + [QCard(a + 1, *Q[a], col), Spacer(1, 3 * mm)]))
for i in range(a + 1, b):
story += [QCard(i + 1, *Q[i], col), Spacer(1, 3 * mm)]
story.append(Spacer(1, 3 * mm))
tips = [
("Point to the pictures in Part 1A while answering. This matches the Cambridge picture style.",
"Показывай на картинки в Части 1A, когда отвечаешь. Это похоже на формат Cambridge с картинками."),
("If the answer is only one word, ask: <b>Why?</b> or <b>Tell me more.</b>",
"Если ответ состоит из одного слова, спросите: <b>Why?</b> («Почему?») или <b>Tell me more.</b> («Расскажи подробнее»)."),
("Sentence starters: <b>I put ... in ...</b> | <b>He is ... now.</b> | <b>I will ... because ...</b>",
"Начала предложений: <b>Я кладу ... в ...</b> | <b>Он сейчас ...</b> | <b>Я буду ..., потому что ...</b>"),
("Cause and effect game: the teacher says the cause, the student gives the effect.",
"Игра «Причина и следствие»: учитель называет причину, ученик называет следствие."),
]
tipdata = [[Paragraph("<font color='white'><b>Teacher and Parent Tips / Советы для учителей и родителей</b></font>", S("t", fontSize=11, leading=15))]]
for en, ru in tips:
tipdata.append([[Paragraph("* " + en, tip), Paragraph(ru, tip_ru)]])
tt = Table(tipdata, colWidths=[W - 30 * mm])
tt.setStyle(TableStyle([("BACKGROUND", (0, 0), (-1, 0), RED), ("BACKGROUND", (0, 1), (-1, -1), CREAM),
("BOX", (0, 0), (-1, -1), 1.5, RED), ("LEFTPADDING", (0, 0), (-1, -1), 8),
("TOPPADDING", (0, 0), (-1, -1), 5), ("BOTTOMPADDING", (0, 0), (-1, -1), 5)]))
story.append(KeepTogether([tt]))
doc = BaseDocTemplate(OUT, pagesize=A4, title="Unit 4 Foods and Mixtures - ESL Speaking Practice (EN/RU)",
author="Orris", leftMargin=15 * mm, rightMargin=15 * mm, topMargin=22 * mm, bottomMargin=15 * mm)
fr = Frame(15 * mm, 13 * mm, W - 30 * mm, H - 36 * mm, id="f", leftPadding=0, rightPadding=0, topPadding=0, bottomPadding=0)
doc.addPageTemplates([PageTemplate(id="cover", frames=[fr], onPage=cover_deco, autoNextPageTemplate="main"),
PageTemplate(id="main", frames=[fr], onPage=page_deco)])
doc.build(story)
print("ok")
cd /tmp/workspace/esl && python3 make_pdf_ru.py && python3 -c " import pdfplumber with pdfplumber.open('Unit4_Foods_and_Mixtures_ESL_Speaking_Practice_RU.pdf') as pdf: print(len(pdf.pages)) for i,p in enumerate(pdf.pages): p.to_image(resolution=65).save(f'rprev{i+1}.png') "
Unit4 Foods and Mixtures ESL Speaking Practice RU
PDF Document · PDF