Script python pour exporter le contenu vers un fichier PDF en utilisant ReportLab. org
Python script to export content to a PDF file using ReportLab. org
Si vous créez un document PDF complexe avec ReportLab, envisagez l'utilisation de la bibliothèque io comme espace de stockage temporaire du fichier PDF.
Complex PDFs If you're creating a complex PDF document with ReportLab, consider using the io library as a temporary holding place for your PDF file.
Si vous exécutez la distribution binaire Windows, vous avez besoin de décompresser ReportLab dans le dossier "web2py/".
If you are running the Windows binary distribution, you need to unzip ReportLab in the "web2py/" folder.
La bibliothèque ReportLab est disponible sur PyPI.
The ReportLab library is available on PyPI.
C'est possible grâce à l'excellente bibliothèque Python libre ReportLab.
Vous constaterez que ces exemples ne contiennent pas beaucoup de code spécifique au format PDF, uniquement les parties utilisant reportlab.
Notice that there isn't a lot in these examples that's PDF-specific - just the bits using reportlab.
Pour plus d'informations sur l'API ReportLab, référez vous à la documentation ReportLab.
For more information about the ReportLab API, refer to the ReportLab documentation.
ReportLab PDF web2py peut aussi générer des documents PDF, avec une librairie additionnelle appelée "ReportLab"[ReportLab].
ReportLab PDF web2py can also generate PDF documents, with an additional library called "ReportLab"[ReportLab].
L'élément clé dans la génération dynamique de PDF avec Django est que l'API de ReportLab agit sur des objets de type fichier, et les objets HttpResponse de Django sont justement des objets de type fichier.
The key to generating PDFs dynamically with Django is that the ReportLab API acts on file-like objects, and Django's FileResponse objects accept file-like objects. Here's a "Hello World" example
Contenu potentiellement sensible ou inapproprié
Les exemples vous aident à traduire le mot ou l’expression cherchés dans des contextes variés. Ils ne sont ni sélectionnés ni validés par nous et peuvent contenir des mots ou des idées inappropriés. Signalez des exemples à modifier ou à retirer. Les traductions potentiellement sensibles, inappropriées ou familières sont généralement marquées de rouge ou d’orange.