wiln / alivepdf

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

addImageStream does not support PNG with alpha #292

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I try to addImageStream using a bitmap that is created dynamically with 
transparent background.

What is the expected output? What do you see instead?
Error: Alpha channel not supported for now
    at org.alivepdf.images::PNGImage/parse()
    at org.alivepdf.images::PDFImage()
    at org.alivepdf.images::PNGImage()
    at org.alivepdf.pdf::PDF/addImageStream()

What version of the product are you using? On what operating system?
Latest version: 0.1.5 RC
Please provide any additional information below.

my function to save a new PDF includes the following code:
var _w:Number = txtContainer.width;
var _h:Number = txtContainer.height;
var bitmap_data:BitmapData = new BitmapData(_w,_h,true,0x00000000);
bitmap_data.draw(txtContainer);//dynamically created MC with Black text in it.
//create and save pdf
myPDF = new PDF("Landscape");
myPDF.addPage();
var ba:ByteArray = PNGEncoder.encode(bitmap_data);//bitmap and transparency
myPDF.addImageStream(ba,"DeviceCMYK",null,0,0,_w,_h);   myPDF.save("remote","http:
//www.mywebsitedomainname.com/create.php","attachment");

Original issue reported on code.google.com by gerry00c...@gmail.com on 8 Dec 2010 at 3:12

GoogleCodeExporter commented 9 years ago
We've now added transparency support.

http://www.moodshare.co/blog/2011/06/transparency-support-for-alivepdf/

Original comment by ja...@moodshare.co on 17 Jun 2011 at 10:23