reportlab

Installation: Reportlab: “ImportError: No module named reportlab.lib”

大城市里の小女人 提交于 2019-12-23 07:14:13
问题 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, and I'm trying to rebuild it. The script works fine, but there's something funky with the RL install, I think. Reportlab: 3.3.0 回答1: Most of the times errors like this are caused by an broken package, either in the package it

ReportLab - error when creating a table

房东的猫 提交于 2019-12-23 04:28:14
问题 This is the first time I've used ReportLab, I have tried to edit an existing script that does exactly what I want to do, but I get the following error, when I try and run the script. Script - import os, arcgisscripting, datetime, getpass, string from reportlab.lib.pagesizes import A4 from reportlab.platypus import * from reportlab.lib import colors from reportlab.lib.styles import ParagraphStyle myWorkspace = r"W:\City.gdb" myReportFolder = r"W:\Reports" myLogosFolder = r"W:\Logos" OpenPDF =

Proper way to add an image file inside a PDF document generated with Reportlab on AppEngine Python

时光怂恿深爱的人放手 提交于 2019-12-22 17:55:45
问题 I'm trying to generate a PDF report using reportlab on App Engine Python. But I don't know how to attach an image properly. The image is static. This is the directory tree of my project. and this is what I do (inside ' chipas.py ') to get the image: im = Image('../static/logo.png',1*inch, 1*inch) story.append(im) ... The stack trace I get: Traceback (most recent call last): File "C:\Users\Lucas\Dropbox\Desarrollo\Python\windows\AppEngine\google\appengine\ext\webapp_webapp25.py", line 701, in

reportlab issue with line breaks using XPreformatted - additionall question mark printed

早过忘川 提交于 2019-12-22 11:11:24
问题 I'm using XPreformatted to print some preformated text and I have an issue with the line breaks. The line breaks are correctly translated but additionaly I get a "question mark" at the end of each line. This is my output: first line? second line? some more text I'm using django with mysql and the database field is a simple varchar field. I checked it in the database and everything what is between the "e" and the "s" in "first linE Second line" is a new line character. With new line character

ReportLab: How to auto resize text to fit block

做~自己de王妃 提交于 2019-12-22 05:36:11
问题 I need to generate a PDF with dynamic text and I'm using ReportLab. Since the text is dynamic, is there anyway to have it resized to fit within a specific area of the PDF? 回答1: Starting in reportlab version 2.0 platypus has KeepInFrame . From the CHANGES.txt : KeepInFrame: Sometimes the length of a piece of text you'd like to include in a fixed piece of page "real estate" is not guaranteed to be constrained to a fixed maximum length. In these cases, KeepInFrame allows you to specify an

Can I inherit from a standard report in OpenERP?

Deadly 提交于 2019-12-21 20:36:01
问题 I want to make changes to the purchase order report in OpenERP 6.1. Do I have to go in and make changes to the purchase module, or can I create a new module that will inherit the standard report and override some details. 回答1: You can't exactly inherit another report and just override some details, but you can replace a standard report and make all existing links to it launch your new report instead. Our zaber_purchase module contains some changes to the purchase order report that our users

Report Lab can't handle hebrew (unicode)

≡放荡痞女 提交于 2019-12-21 17:52:51
问题 I am trying to generate the pdf from following python programming but generated output doesn't display hebrew letters correctly # -*- coding: utf-8 -*- from reportlab.pdfgen import canvas def hello(c): c.drawString(100,100, "מה שלומך") c = canvas.Canvas("hello.pdf") hello(c) c.showPage() c.save() 回答1: This code (see below) works! All you need to do is place ArialHB.ttf (or any other font that supports Hebrew characters) into site-packages/reportlab/fonts ... The desired output will be at the

Appengine - Reportlab (Get Photo from Model)

狂风中的少年 提交于 2019-12-21 17:21:48
问题 I´m using Reportlab to generate a PDF. Can´t retrieve a photo from a model. #Personal Info p.drawImage('myPhoto.jpg', 40, 730) p.drawString(50, 670, 'Your name:' + '%s' % user.name) p.drawImage (50, 640, 'Photo: %s' % (user.photo)) When i create on generate PDF, i got this error: Traceback (most recent call last): File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\webapp\__init__.py", line 513, in __call__ handler.post(*groups) File "C:\Users\hp\workspace\myApp\src\main

how to group objects in reportlab, so that they stay together across new pages

喜你入骨 提交于 2019-12-21 04:06:27
问题 I'm generating some pdf files using reportlab. I have a certain section that is repeated. It contains of a header and a table: Story.append(Paragraph(header_string, styleH)) Story.append(table) How can I group the paragraph with the table (in latex I would put them into the same environment) so that in case of a page brake, the paragraph and table stay together? Currently the paragraph sometimes floats at the end of one page and the table starts on top of the next page. 回答1: You can try to

Reportlab: header with data from page

旧巷老猫 提交于 2019-12-19 21:27:29
问题 I'm using the on page function and a page template to make headers for a subset of the pages in my document: templates.append(PageTemplate(id='Overview', frames=frame, onPage=HeaderOverview)) The header function for this template: ################################ # Function HeaderOverview - header for overview page def HeaderOverview(canvas,doc): canvas.saveState() headboxh = 15 headboxx = 20 headboxy = 730 headboxw = 570 canvas.rect(headboxx, headboxy, headboxw, headboxh, fill=1) canvas