Hello Friend,

I want to create a multi page PDF file by as 3.0. I am using AlivePDF class
for this. My each page dimension is A4 size. Whenever I am going to create
the PDF file it is not working. I am also using JPEG encoder for PDF
creation. Below is my code.


I have used *BitmapDataUnlimited *class as Flash doesn't support more than
2880 px. So instead of *BitmapData *I used it.





***********************************************************************************

             private static function makeJPG():void {

var bitmapdataU:BitmapDataUnlimited = new BitmapDataUnlimited();
 bitmapdataU.addEventListener(BitmapDataUnlimitedEvent.COMPLETE,
bitmapReady);
 bitmapdataU.addEventListener(BitmapDataUnlimitedEvent.ERROR, onBmpError);

bitmapdataU.create(2000, 2000, true);

    }

               private static function
bitmapReady(e:BitmapDataUnlimitedEvent):void {

                        var rect:Rectangle = new
Rectangle(0,0,GlobalSetting.PRINT_WIDTH_PIXEL,
GlobalSetting.PRINT_HEIGHT_PIXEL);
 var matx:Matrix = new Matrix();
matx.tx = rectPos;
 var BData:BitmapDataUnlimited = e.target as BitmapDataUnlimited;
 BData.draw(container, null, null, rect, true);

jpegEnc = new JPGEncoder300(80);
 jpegData = jpegEnc.encode(BData.bitmapData);
generatePDF(jpegData);
            }

             private static function
generatePDF(pageBytesArray:ByteArray):void {
                        pdfEncoder.addPage();
pdfEncoder.addImageStream(pageBytesArray, 0, 0, 0, 0, 1,
ResizeMode.FIT_TO_PAGE);

                      if(num < 5){

                          num ++;
                          makeJPG():

                      }else{


                               pdfEncoder.save(Method.REMOTE, "savepdf.php",
Download.ATTACHMENT, "myPDF.pdf" );
                           }

            }










-- 
*Arindam Mojumder*
*
*

Visit My Flickr  <http://www.flickr.com/photos/arindam-mojumder/sets/>
<http://www.flickr.com/photos/arindam-mojumder/sets/>Visit My Facebook
<http://www.facebook.com/Arinda.Mojumder>
 <http://twitter.com/arindam_arindam>Visit My Twitter
Account<http://twitter.com/arindam_arindam>
 <http://scripto-mania.blogspot.com/>Visit My
GBlogger<http://scripto-mania.blogspot.com/>
 <http://nilbristi.wordpress.com/>Visit My Wordpress
Blog<http://nilbristi.wordpress.com>

-- 
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en.

Reply via email to