473,569 Members | 3,043 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: Reportlab Image object opens filehandles

Daniel de Sousa Barros wrote:
>
----- Original Message ----- From: "norseman" <no******@hughe s.net>
To: "Daniel de Sousa Barros" <da*******@hotm ail.com>
Cc: <py*********@py thon.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
manipulation s 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.drawHeig ht = 18*cm * imagem.drawHeig ht / imagem.drawWidt h
imagem.drawWidt h = 18*cm
story.append(im agem)
dados = [
[colab, ''],
[imagem, '']
]
tabela = Table(dados, [19.3*cm, 0.01*cm], repeatRows=True )
tabela.hAlign = "LEFT"
story.append(ta bela)
story.append(Sp acer(0*cm, 1*cm))
doc.build(story , onFirstPage = cabecalhoRetrat o,
onLaterPages=ca becalhoRetrato)
-----------------------------------------------------------------------------------------------
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 1458

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

Similar topics

3
5293
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 available truetype font that works with UTF8? -aj
0
1116
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 renderPM. Henning von Bargen's LongTables optimisation. Marc Stober's underline fixes. Restored/improved platypus layout error detection. New...
4
5362
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 called reportlab.pth in the pythod dir. The only line in this file is supposed to be the path to the reportlib dir. Then I'm instructed to open the ......
15
31780
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 help. Regards
68
4099
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 made to return a specific image format as an image object, such as PSD (Only for viewing purposes). Thanks in advance Nick.
2
7478
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) appears to the right of the text. The image always appears first and then the text below on the next line. Please help. Chuck
0
816
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 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...
16
8624
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, latin2, arabic, chinese and other languages at the same time. Is there a single font that is able to handle these languages? (Most of our invoices will...
0
847
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 has contributed to the open-source toolkit in the run-up to the 2.2 release, whether by reporting bugs, sending patches, or contributing to the...
0
8138
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7681
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5514
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5228
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3662
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1229
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
950
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.