bonjour à tous,

j'ai un fichier.py qui génère un PDF avec le module Reportlab qui fonctionne bien sous PyCharm

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
    # ===================
    #        --- Création PDF ---
    # ===================
    from reportlab.pdfgen import canvas
    from reportlab.platypus import Paragraph, Table, TableStyle, Frame, Image, ParagraphAndImage
    from reportlab.lib.styles import ParagraphStyle
    from reportlab.lib.styles import getSampleStyleSheet
    from reportlab.lib.units import mm
 
    # Format de la feuille
    from reportlab.lib.pagesizes import landscape
    from reportlab.lib.pagesizes import A4
 
    # Police Verdana
    from reportlab.pdfbase.pdfmetrics import registerFont
    from reportlab.pdfbase.ttfonts import TTFont
    registerFont(TTFont('Verdana', 'VERDANA.TTF'))
    registerFont(TTFont('Verdana-Bold', 'VERDANAB.TTF'))
    registerFont(TTFont('Verdana-Italic', 'VERDANAI.TTF'))
    registerFont(TTFont('Verdana-BoldItalic', 'VERDANAZ.TTF'))
 
    registerFont(TTFont('THSarabun', 'THSarabun.ttf'))
    registerFont(TTFont('THSarabun-Bold', 'THSarabun.ttf'))
    registerFont(TTFont('THSarabun-italic', 'THSarabun.ttf'))
    registerFont(TTFont('THSarabun-BoldItalic', 'THSarabun.ttf'))
 
    registerFont(TTFont('arabtype', 'arabtype.ttf'))
 
    #
    from reportlab.lib import colors
je contre un problème de non fonctionnement en voulant créer un éxecutable avec auto-py-toe-exe https://pypi.org/project/auto-py-to-exe/
Nom : _40.jpg
Affichages : 1159
Taille : 9,5 Ko

j'ai testé en spécifier le chemin d'installation reportlab pour l'option "--additonal-hooks-dir-"
C:\Users\master\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\reportlab

de l'aide s'il vous plaît, merci de votre temps