reportlab

Dynamic framesize in Python Reportlab

Dynamic framesize in Python Reportlab Question: I tried to generate a shipping list with reportlab in Python. I was trying to put all parts (like senders address, receivers address, a table) in place by using Platypus Frames. The first problem that I ran into was that I needed a lot of Frames to position everything …

Total answers: 2

Installation: Reportlab: "ImportError: No module named reportlab.lib"

Installation: Reportlab: "ImportError: No module named reportlab.lib" Question: I’ve installed reportlab, via pip install reportlab (also tried via easy_install reportlab ) ..but I get the above error. There are other RL imports before that – it’s the .lib that it’s objecting to. I’ve had RL working great in the past, but IT reimaged my computer, …

Total answers: 6

ReportLab: working with Chinese/Unicode characters

ReportLab: working with Chinese/Unicode characters Question: TL;DR: Is there some way of telling ReportLab to use a specific font, and fallback to another if glyphs for some characters are missing? Alternatively, Do you know of a condensed TrueType font which contains the glyphs for all European languages, Hebrew, Russian, Chinese, Japanese and Arabic? I’ve been …

Total answers: 3

Export Pandas DataFrame into a PDF file using Python

Export Pandas DataFrame into a PDF file using Python Question: What is an efficient way to generate PDF for data frames in Pandas? Asked By: b8con || Source Answers: Well one way is to use markdown. You can use df.to_html(). This converts the dataframe into a html table. From there you can put the generated …

Total answers: 6

Python pip install reportlab error

Python pip install reportlab error Question: I am trying to install reportlab for python. I have Windows 7, Python 2.7 and Visual Studio 2013 and I am using the command line “pip install reportlab” but it is not working. I have the pip log file data that was generated – what is the best way …

Total answers: 3

dict_items object has no attribute 'sort'

dict_items object has no attribute 'sort' Question: First of all I am new to Python. I am using PTVS http://pytools.codeplex.com/. Next I installed reportlab. Then I run a sample demo at https://github.com/nakagami/reportlab/blob/master/demos/colors/colortest.py#L68 But at line, all_colors = reportlab.lib.colors.getAllNamedColors().items() all_colors.sort() # alpha order by name I am getting error, dict_items object has no attribute sort Asked …

Total answers: 3

Python ReportLab — Table too wide for page

Python ReportLab — Table too wide for page Question: I’m using the ReportLab package for python to create a table in a PDF file, but the table is too wide for the page and the first and last columns cut off. Here is a sample of the code I’m using. t = Table(data, style=[(“INNERGRID”, (0,0), …

Total answers: 4

Python PyPDF2 merge rotated pages

Python PyPDF2 merge rotated pages Question: I’m using python ReportLab canvas to generate overlay document with watermarks to merge it into source pdf document (with PyPDF2). Recently I encountered a problem with a document that contains rotated pages (/Rotate key is present for Page object in pdf). This document looks ok on devices and printers. …

Total answers: 1

Python Reportlab Paragraph not crossing over next page

Python Reportlab Paragraph not crossing over next page Question: Currently I am trying to create PDF documents with reportlab in python. On each page of my PDF , it will have multiple questions like this: After looking around, i tried to achieve this format by using Platypus SimpleDocTemplate and Platypus Paragraph. Like this (FYI – …

Total answers: 1

Multiple pages using Reportlab – Django

Multiple pages using Reportlab – Django Question: I’m working in a site using Django and I print a .pdf file using Repotlab. Now, I want the file to have multiple pages, how can I do it? My code: from reportlab.pdfgen import canvas from django.http import HttpResponse def Print_PDF(request): response = HttpResponse(content_type=’application/pdf’) response[‘Content-Disposition’] = ‘attachment; filename=”resume.pdf”‘ …

Total answers: 1