mesaglam / alivepdf

Automatically exported from code.google.com/p/alivepdf
0 stars 0 forks source link

Trouble addImage, Error #2015 #38

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I want to add an Image, but it doesn't work? I have the following code:

var  im:Image = new Image();
im.source = "assets/images/blume3.jpg";

myPDF.addImage(im,1,null,null,false,ImageFormat.JPG);

But there is always the error:
ArgumentError: Error #2015: Ungültiges BitmapData. 

Has anybody an idea?

Isa

Original issue reported on code.google.com by isabelma...@googlemail.com on 3 Apr 2008 at 10:35

GoogleCodeExporter commented 9 years ago
The image much be completely loaded before it can be added to the PDF.  You 
will need to add a listener to the 
image class and then create your PDF after your image has been fully loaded.   
I generally create a method just to 
load all the images into a cache and then proceed with building the PDF.

You can also create a global image cache (look at SuperImage) so that images 
that have previously been loaded 
can be accessed for PDF creation. 

Original comment by onefootp...@gmail.com on 24 Apr 2008 at 1:51