Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Flex > Flex 2, 3 & 4

Reply
 
Thread Tools Rate Thread Display Modes
Old 09-09-2011, 08:10 AM   #1
xmag
Registered User
 
Join Date: Sep 2011
Posts: 2
Red face Alivepdf, insert image (dynamic variable)

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!
xmag is offline   Reply With Quote
Old 09-09-2011, 05:15 PM   #2
iSynapps
print4dummies
 
iSynapps's Avatar
 
Join Date: Dec 2010
Location: Germany
Posts: 97
Send a message via Skype™ to iSynapps
Default

I had same issue some time ago. I solved my problem by loading the image (url:string) and assigning it to a Image() component. Take a look on AlivePDF docs and you will see that the addImage() first element is a DisplayObject and what you're trying to assign into it is a Loader() :P
__________________
Need a free business card design?
http://print4dummies.com/?url=produc...RlIDMuNXgyaW4=
iSynapps is offline   Reply With Quote
Old 09-12-2011, 06:10 AM   #3
xmag
Registered User
 
Join Date: Sep 2011
Posts: 2
Default

Thanks for the reply
Yes, I have seen my error and correct it with imgLdr.content but it still not working.
I will test an url
xmag is offline   Reply With Quote
Old 04-20-2012, 04:46 AM   #4
Tio El
Registered User
 
Join Date: Apr 2012
Posts: 3
Default

Just wondering did you get this to work? any chance of zipped code. ive been pulling my hair out with this issue. the the only issue im having with alivePDF!!!
Tio El is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:10 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.