AlivePDF icon indicating copy to clipboard operation
AlivePDF copied to clipboard

addImageStream does not support PNG with alpha

Open GoogleCodeExporter opened this issue 10 years ago • 1 comments

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 [email protected] on 8 Dec 2010 at 3:12

GoogleCodeExporter avatar Oct 22 '15 18:10 GoogleCodeExporter

We've now added transparency support.

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

Original comment by [email protected] on 17 Jun 2011 at 10:23

GoogleCodeExporter avatar Oct 22 '15 18:10 GoogleCodeExporter