1

Spending hours to add base64 encoded string as image to PDF by addImageStream with no success:

var decoder:Base64Decoder = new Base64Decoder();
decoder.decode(imgdata);
var ba:ByteArray = decoder.toByteArray();
pdf.addImageStream(ba, ColorSpace.DEVICE_RGB);

The string data itself looks good, but addImageStream breaks PDF generation for unknown reason, whats wrong?

using Apache Flex SDK 4.14 with AlivePDF 0.1.5 RC

Update|Solved: With JPEG type it works, finally found that alivePDF has issues with PNG transparency which is returned internally when encoding, its by default even if there isnt transparency in image and cant be turned off.

ketan
  • 19,129
  • 42
  • 60
  • 98
defme
  • 11
  • 3
  • Hi, I am also using the same code to add image in PDF using the base64. I want to know that for **Base64Decoder** which namespaces you have used because when i am adding these line in my .as file getting error : _Description Resource Path Location Type 1046: Type was not found or was not a compile-time constant: Base64Decoder._ – Ramesh Joshi Mar 18 '15 at 06:52
  • im using mx.utils.Base64Decoder – defme Apr 04 '15 at 17:09

0 Answers0