Select to view content in your preferred language

Unable to resolve "filename" for transcoding

953
4
06-11-2010 09:42 AM
MicheleDunham
Emerging Contributor
I would like to embed a static map legend png into the CreatePDF code posted elsewhere in the Flex forum.  The embedding code looks like this..

[Embed(source="/assets/images/basemaplegend.png")]
[Bindable]
var pngBytes:Class;

myPDF.addImageStream( new pngBytes() as ByteArray, 0, 0, 0, 0, 1, "false");

I have tried every permutation listed on the Internet with this one; changing the source string; copying the file to different subdirectories...nothing works...

Any suggestions???
Tags (2)
0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus
Michele,

   I have found that AlivePDF has an issue using images that support Alpha in their addImageStream function. Just change the image to a JPG.
0 Kudos
KenBuja
MVP Esteemed Contributor
I've used this code to created the embedded image that I use with AlivePDF

[Embed(source="/assets/Images/Boundary.png", mimeType="application/octet-stream")] var legendBoundary:Class;
0 Kudos
MicheleDunham
Emerging Contributor
Robert, I tried switching the file to a jpg but I still get the error.  The error occurs in the EMBED tag...the compiler can't resolve the filename location in the application subdirectory.  There are lots of posts of this problem and everyone seems to have a different solution.  I've copied the file everywhere in the app directory and used every kind of reference I can think of to no avail...Mansoor has blogged this problem too...  Thanks, Michele
0 Kudos
MicheleDunham
Emerging Contributor
I finally got this code to work by copying the png file into the subdirectory of the widget...this solution was posted elsewhere...and I had to try it a few times to get it to work...I also added back the mimeType at your suggestion Ken.  Thanks.

[Embed( source="basemaplegend.png", mimeType="application/octet-stream")]
private var pngBytes:Class;
0 Kudos