473,382 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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 1445

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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.