aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tests/reportlab
diff options
context:
space:
mode:
author简律纯 <i@jyunko.cn>2023-10-07 17:48:53 +0800
committer简律纯 <i@jyunko.cn>2023-10-07 17:48:53 +0800
commit694062d71ed41d0aa9cc9842ae9085afd37dfbe2 (patch)
tree74bd58ff5b65af97ab2a7143341f2ac6ac4fe445 /tests/reportlab
parent98e083b124abb860f09568bb9688672af2d5de29 (diff)
downloadinfini-694062d71ed41d0aa9cc9842ae9085afd37dfbe2.tar.gz
infini-694062d71ed41d0aa9cc9842ae9085afd37dfbe2.zip
feat(css): change style
Diffstat (limited to 'tests/reportlab')
-rw-r--r--tests/reportlab/1.1.py32
-rw-r--r--tests/reportlab/card.pdfbin0 -> 50964 bytes
-rw-r--r--tests/reportlab/card.pngbin0 -> 1945 bytes
3 files changed, 32 insertions, 0 deletions
diff --git a/tests/reportlab/1.1.py b/tests/reportlab/1.1.py
new file mode 100644
index 00000000..0cd4ee8d
--- /dev/null
+++ b/tests/reportlab/1.1.py
@@ -0,0 +1,32 @@
+from reportlab.lib import colors
+from reportlab.graphics.shapes import (Drawing, Rect, String, Line, Group)
+from reportlab.pdfbase.pdfmetrics import registerFont
+from reportlab.pdfbase.ttfonts import TTFont
+
+# font
+registerFont(TTFont("Times", "C:\Windows\Fonts\Times.ttf"))
+
+drawing = Drawing(400, 200)
+# beige rectangle
+r1 = Rect(0, 0, 400, 200, 0, 0)
+r1.fillColor = colors.beige
+drawing.add(r1)
+
+# logo
+wave = Group(
+ Line(10, -5, 10, 10),
+ Line(20, -15, 20, 20),
+ Line(30, -5, 30, 10),
+ Line(40, -15, 40, 20),
+ Line(50, -5, 50, 10),
+ Line(60, -15, 60, 20),
+ Line(70, -5, 70, 10),
+ Line(80, -15, 80, 20),
+ Line(90, -5, 90, 10),
+ String(25, -25, "Wave Audio", fontName='Times')
+)
+wave.translate(10, 170)
+drawing.add(wave)
+
+# save
+drawing.save(formats=['pdf', 'png'], outDir=".", fnRoot="card") \ No newline at end of file
diff --git a/tests/reportlab/card.pdf b/tests/reportlab/card.pdf
new file mode 100644
index 00000000..4cb0b58a
--- /dev/null
+++ b/tests/reportlab/card.pdf
Binary files differ
diff --git a/tests/reportlab/card.png b/tests/reportlab/card.png
new file mode 100644
index 00000000..5c1cd4a5
--- /dev/null
+++ b/tests/reportlab/card.png
Binary files differ