From d3bc8809e4aace9f5ba7405e0a997907d863a605 Mon Sep 17 00:00:00 2001 From: Lyubomir Mitkov Date: Thu, 16 Dec 2021 12:56:31 +0200 Subject: [PATCH 1/2] fix(app): when try to pass down special characters (Cyrillic letters, umlauts, etc.), for generation of PDF it comes out broken --- app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 9853e56..7be2491 100644 --- a/app.py +++ b/app.py @@ -52,8 +52,8 @@ def home(): def generate(): name = request.args.get('filename', 'unnamed.pdf') app.logger.info('POST /pdf?filename=%s' % name) - #print ( request.get_data() ) - html = HTML(string=request.get_data()) + #print ( request.get_data(as_text=True) ) + html = HTML(string=request.get_data(as_text=True)) css, font_config = css_for_extra_fonts() pdf = html.write_pdf(stylesheets=[css], font_config=font_config) response = make_response(pdf) From b3253d1424bb6c2f5fd52cc136d357166669d146 Mon Sep 17 00:00:00 2001 From: Lyubomir Mitkov Date: Thu, 6 Jan 2022 16:05:18 +0200 Subject: [PATCH 2/2] test(app): add few examples with special characters in `test.html` --- test.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test.html b/test.html index 2a0e535..5f90fd3 100644 --- a/test.html +++ b/test.html @@ -5,5 +5,9 @@

Hello World

+

Hello Wêreld!

+

Здравей свят!

+

გამარჯობა მსოფლიო!

+

Përshendetje Botë!

\ No newline at end of file