Hi!
I want to insert image in a PDF, this works:
ActionScript Code:
[Embed( source="assets/images/mon_image.jpg", mimeType="application/octet-stream" )]
var jpgBytesP:Class;
portPDF.addImageStream(new jpgBytesP() as ByteArray, "DeviceRGB",null, 3, 115, 50, 0);
But I want to place my image URL into a variable (getting in a XML config file) and it doesn't work fine: the image is not displayed in the PDF file.
Here is my code:
ActionScript Code:
landPDF=new PDF(Orientation.LANDSCAPE,Unit.MM,Size.LETTER);
....
imgLdr = new Loader();
imgLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, ImageLoadComplete);
req = new URLRequest(myImage);
imgLdr.load(req);
function ImageLoadComplete(e : Event):void
{
landPDF.addImage(imgLdr,
new Resize(Mode.NONE,Position.LEFT),
0,0,
100,0,
0,1,false,
ImageFormat.JPG,
100,
Blend.NORMAL, null);
}
no error in debug mode...
thanks for help!