Python Forum
cyrillic symbols in tables in reportlab.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
cyrillic symbols in tables in reportlab.
#3
(Mar-19-2019, 07:39 PM)Larz60+ Wrote: see: http://code.activestate.com/recipes/4388...f-library/

Thanks for your answer! Unfortunately this does not work, the problem is not that there is no suitable font, I think,that there should be some other way to change the font in the table is not through canvas

I added this code to my, the one that led above, now it gives me just a blank sheet

If I'm going on and fix the font to a normal string that is printed by using canvas, it's all right and the characters are introduced, the problem is that whatever font I set in canvas, SimpleDocTemplate.build won't use it and I don't know why. Here is a sample code that prints the Cyrillic alphabet canvas

from reportlab.pdfgen.canvas import Canvas
from reportlab.lib.pagesizes import A4
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont


canvas = Canvas("canvas.pdf", pagesize=A4)
pdfmetrics.registerFont(TTFont('FreeSans', 'FreeSans.ttf'))
canvas.setFont('FreeSans', 32)
canvas.drawString(10, 150, "Сам текст энкодед ин UTF-8")
canvas.drawString(10, 100, "Шревтом FreeSans!")
canvas.showPage()
canvas.save()
That's what I get. Everything works:
Here is the code from the first table, but with the addition of what I drop above:
That's what I get on the way out.
Reply


Messages In This Thread
cyrillic symbols in tables in reportlab. - by hiroz - Mar-19-2019, 06:09 PM
RE: cyrillic symbols in tables in reportlab. - by hiroz - Mar-19-2019, 08:17 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python script that deletes symbols in plain text nzcan 3 708 Sep-05-2023, 04:03 PM
Last Post: deanhystad
  [SOLVED] Looking for documentation on Reportlab's canvas.transform() function NeilUK 1 624 Aug-23-2023, 01:21 PM
Last Post: NeilUK
  Right to left alignment in python report using Reportlab jalal0034 1 1,856 Sep-27-2022, 04:25 AM
Last Post: jalal0034
Question Trouble installing modules/libraries and getting Notepad++ to show cyrillic letters Dragiev 6 2,289 Jul-24-2022, 12:55 PM
Last Post: Dragiev
  Label Maker FPDF, Reportlab jamesaarr 1 2,689 Aug-09-2021, 11:57 PM
Last Post: Pedroski55
  Using Reportlab to create a landscape pdf SmukasPlays 2 5,478 Aug-09-2020, 09:31 PM
Last Post: SmukasPlays
  Unexpected output: symbols for derivative not being displayed saucerdesigner 0 2,072 Jun-22-2020, 10:06 PM
Last Post: saucerdesigner
  Help! - How to create a Title for a Reportlab Table crabbylou 0 5,378 Mar-29-2020, 09:14 PM
Last Post: crabbylou
  ReportLab Polypop77 0 1,847 Mar-20-2020, 01:17 PM
Last Post: Polypop77
  Replacing symbols by " Tiihu 1 1,894 Feb-13-2020, 09:27 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020