Last active
September 25, 2017 13:47
-
-
Save leotada/2b1779f707f8b6a0a4f84d60e4cc0ae3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from reportlab.pdfgen import canvas | |
from reportlab.pdfbase import pdfmetrics | |
from reportlab.pdfbase.ttfonts import TTFont | |
from reportlab.lib.units import cm | |
from reportlab.lib.pagesizes import A4 | |
c = canvas.Canvas("hello.pdf", pagesize=A4) | |
# auto generated elements | |
texto = c.drawString(1*cm, 2*cm, "Teste 1") | |
texto = c.drawString(30, 200, "Segunda frase") | |
texto = c.drawString(50, 400, "Terceira frase") | |
texto = c.drawString(80, 600, "Esta frase contêm acentos.") | |
texto = c.drawString(150, 800, "Teste: #$#$(#$*@*%@#L$PTOI$). Ok") | |
# Save | |
c.showPage() | |
c.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment