473,467 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Re: Reportlab Image object opens filehandles

Daniel de Sousa Barros wrote:
>
----- Original Message ----- From: "norseman" <no******@hughes.net>
To: "Daniel de Sousa Barros" <da*******@hotmail.com>
Cc: <py*********@python.org>
Sent: Tuesday, July 08, 2008 6:49 PM
Subject: Re: Reportlab Image object opens filehandles

>>
Daniel de Sousa Barros wrote:
>>Hi Mr Robin,

I saw your post:
http://mail.python.org/pipermail/pyt...er/224781.html

I'm trying to append more than 1000 images into one PDF report, but i
get the IOError: Too many...

know you a solution for it?

Sorry by my english.... i'm brazilian and i'm learning english yet...
------------------------------------------------------------------------

--
http://mail.python.org/mailman/listinfo/python-list
====================
If you are using Microsoft:

First reaction: Increase the system pagefile (virtual memory) size.

Assuming lots of spare disk space you could change it to the 'on
demand' or 'let system handle it' setting. I don't know about Vista
but the rest top out about 4(or 2?)Gig per pagefile per disk. Forgot
which.

I don't know what imagery handling software you have, but if able, you
could consider 1) resizing images to final printed paper display size
and 2) make sure they are at or below 200dpi and jpeg in format before
entering them into the report.

If you are in Linux:

see the man pages on mkswap and swapon. Use files for swapspace. Easy
to create, easier to remove. Don't need to reconfigure hard drive. Can
be on another mounted drive. Use AbiWord or OpenOffice to set up text
pictures and all, print to file (will be a postscript) and use
ghostview (gv) to check results then use ghostscript (gs) to convert
to pdf. Final review in xpdf. ImageMagic's convert will do the image
manipulations mentioned in last paragraph of Microsoft section and
then some. All programs mentioned in the Linux section plus the
operating system are free for the download.
Steve
no******@hughes.net
================================================== ==

I'm trying to generate de report using reportlab + PIL.

This is the code:

------------------------------------------------------------------------------------------

for i in lista:
colab = Paragraph(i[0], style('1_b'))
imagem = Image(i[1]) #i tried lazy=2, but i get an error like this :
"_file"
imagem.drawHeight = 18*cm * imagem.drawHeight / imagem.drawWidth
imagem.drawWidth = 18*cm
story.append(imagem)
dados = [
[colab, ''],
[imagem, '']
]
tabela = Table(dados, [19.3*cm, 0.01*cm], repeatRows=True)
tabela.hAlign = "LEFT"
story.append(tabela)
story.append(Spacer(0*cm, 1*cm))
doc.build(story, onFirstPage = cabecalhoRetrato,
onLaterPages=cabecalhoRetrato)
-----------------------------------------------------------------------------------------------
I only need to increase the virtual memory? How i do it? I'm using
windows xp.

================================================

Click Start/settings/control panel/system/advanced/settings(in \
performance area)/advanced/change

set System managed size on
click SET box to right of above line
click positives (OK APPLY etc.) all way out, system will probably reboot

what is 'cm' in your code? In my world it means centimeter.

If you are trying to create full scale templates via raster methods you
will probably need more than 'Mom's" email machine. Junior's whiz-bang
game computer box probably won't work either.

Even at 72dpi
(72*72)*((18*2.54)*(18*2.54))*3
5184 *( 45.72 * 45.72) * 3
5184 * 2090.318 * 3
10,836,208 * 3
35,508,625.536 bytes per image
72dpi is normal for PDF/Postscript
5184 is dots per square inch
2090.318 is square inches per image
3 is one byte each, red,green,blue

Add margins and offsets and space between and.... even without that,
35.5 million times 1000 = 35500 million or 35.5 Gigabytes !!!?
In one file? Microsoft is going to have a problem with you. :)
If that is what you are trying to do - reach me direct. I'll show you
how. One of my photos takes 4 DVD's AFTER a 15 to 1 reduction in size.
Can't find a calculator? 4*4.5*15 = 270Gigs uncompressed, more or less.
Steve
no******@hughes.net
Jul 11 '08 #1
0 1447

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Andreas Jung | last post by:
Reportlab has some problems with creating PDFs from UTF8 encoded text. For this reason they are using a truetype font rina.ttf which looks *very ugly*. Does anyone know of a suitable free...
0
by: Robin Becker | last post by:
Version 1.19 of the ReportLab Toolkit has been released. Fixes from Max Neunhöffer (pyRXP) and Peter Borocz (pdfmetrics). ReportLab graphics now has some 3D charts. Support for True Type Fonts in...
4
by: Active8 | last post by:
I did this once and can't remember how <blush> so I read the reportlab user guid. It says to unzip the reportlab archive - this is on w2k, BTW, with Python23 - to a directory and make a file...
15
by: Anand Ganesh | last post by:
HI All, I have an Image. I want to clip a portion of it and copy to another image. How to do this? I know the bounding rectangle to clip. Any suggestions please. Thanks for your time and...
68
by: Nak | last post by:
Hi there, This might sound like a silly question but, technically could an image object be used for any image format? For example if I were to make plugins for my application, could they be...
2
by: Chuck | last post by:
I have been trying all day to get this to work. My complete code is below. I can get my text into the PDF, I can get my image in the PDF. What I can't get to work is frames so that the image (logo)...
0
by: norseman | last post by:
Daniel de Sousa Barros wrote: ==================== If you are using Microsoft: First reaction: Increase the system pagefile (virtual memory) size. Assuming lots of spare disk space you could...
16
by: Laszlo Nagy | last post by:
I need to create multi lingual invoices from reportlab. I think it is possible to use UTF 8 strings but there is a problem with the font. I could not find any free TTF font that can do latin1,...
0
by: Robin Becker | last post by:
Version 2.2 of the ReportLab open-source toolkit is out! You find downloads and src instructions at http://www.reportlab.org/downloads.html. Contributions ============= Thanks to everybody who...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.