gdtiti / alivepdf

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

AddImageStream + base64 encoded stream #164

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

var imageSnap:ImageSnapshot = ImageSnapshot.captureImage(barChart, 72, new
PNGEncoder());
var i64:String = ImageSnapshot.encodeImageAsBase64(imageSnap);
var base64Decoder:Base64Decoder = new Base64Decoder();
base64Decoder.decode(i64);
var byeArray:ByteArray = base64Decoder.toByteArray();
myPDF.addImageStream(byeArray);

What is the expected output? What do you see instead?

Error: Alpha channel not supported
    at
org.alivepdf.images::PNGImage/parsePNG()[C:\Users\Patrick\workspace\decider\src\
org\alivepdf\images\PNGImage.as:46]

What version of the product are you using? On what operating system?

0.1.4.9 Vista

Please provide any additional information below.
I'm using a lot Base64 encoded images in a sqlite db.
Would like to use them :)

Thanks,
Patrick

Original issue reported on code.google.com by patrick....@gmail.com on 21 Oct 2009 at 9:39

GoogleCodeExporter commented 9 years ago
I think I'm experiencing the same error with this code:

var image:ImageSnapshot = ImageSnapshot.captureImage(parentApplication.mChart, 
300,
new PNGEncoder());
myPDF.addImageStream(image.data, 0, 0, image.width, image.height);

Error: Alpha channel not supported
    at org.alivepdf.images::PNGImage/parsePNG()[/Users/timbert/Documents/Flex Builder
3/AlivePDF/src/main/flex/org/alivepdf/images/PNGImage.as:46]
    at org.alivepdf.images::PNGImage()[/Users/timbert/Documents/Flex Builder
3/AlivePDF/src/main/flex/org/alivepdf/images/PNGImage.as:19]
    at org.alivepdf.pdf::PDF/addImageStream()[/Users/timbert/Documents/Flex Builder
3/AlivePDF/src/main/flex/org/alivepdf/pdf/PDF.as:3304]
    at VaxSafetyReport_view/createPDF()[C:\Documents and
Settings\cdowney\workspace-flex3\TLC\src\VaxSafetyReport_view.mxml:150]
    at VaxSafetyReport_view/___VaxSafetyReport_view_Button1_click()[C:\Documents and
Settings\cdowney\workspace-flex3\TLC\src\VaxSafetyReport_view.mxml:159]

VERSION: 0.1.4.9 / OS: Windows XP

Additional Info:

This code (using the same DisplayObject) works just fine:
myPDF.addImage(parentApplication.mChart,X,myPDF.getY()+20,0,0,ImageFormat.PNG,10
0,1);

I'm hoping that this bug gets fixed soon so I can use higher quality snapshots.

Thank you!

Original comment by cdow...@gmail.com on 4 Nov 2009 at 1:21

GoogleCodeExporter commented 9 years ago
Could you provide the code that defines the parentApplication?

I have a similar issue and will see what I come up with.

Original comment by mortens...@gmail.com on 17 Nov 2009 at 4:39

GoogleCodeExporter commented 9 years ago
Inside the parentApplication, mChart is the name of a form within an Accordion
container.  The form contains MercuryBarChart2, which is a Canvas container that
hosts a ColumnChart and TextArea.  

<mx:Accordion creationPolicy="all">
<mx:Form label="Vaccine Selection" backgroundColor="#E0E0F2" id="mCalcForm">
    <local:MercuryCalc id="mCalc"/>
</mx:Form>
<mx:Form label="Mecury Calculation Chart" backgroundColor="#E0E0F2">
    <local:MercuryBarChart2 id="mChart"/>
</mx:Form>
<mx:Form label="Your Custom Vaccination Record" backgroundColor="#E0E0F2">
    <local:VaxSafetyReport_view/>
</mx:Form>
<mx:Form label="About" backgroundColor="#E0E0F2">
    <local:About/>
</mx:Form>
</mx:Accordion>

Please let me know if there is anything else that would be helpful.

Original comment by cdow...@gmail.com on 17 Nov 2009 at 4:49

GoogleCodeExporter commented 9 years ago
I think I am having a similar issue, but only when loading an external PNG. 
Embedded 
PNG's and DisplayObject snapshots are fine.

Error: Alpha channel not supported

version 0.1.4.8
Windows 7

Original comment by chris.fa...@gmail.com on 7 Apr 2010 at 3:55