Open GoogleCodeExporter opened 8 years ago
I have created a demo app for generating pdf from a VBox with dynamic
child....it
doesn't work either. Take a look. I am using Flex4 SDK to save the PDF locally
in FP 10.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:Script>
<![CDATA[
import org.alivepdf.images.ResizeMode;
import org.alivepdf.saving.Method;
import org.alivepdf.images.ImageFormat;
import org.alivepdf.pages.Page;
import org.alivepdf.display.*;
import org.alivepdf.layout.*
import org.alivepdf.pdf.PDF;
private var mPDF:PDF;
private function onPDFCreate():void
{
mPDF = new PDF(Orientation.PORTRAIT, Unit.MM, Size.A4 );
mPDF.setDisplayMode( Display.FULL_PAGE, Layout.SINGLE_PAGE );
mPDF.setTitle('Module');
for(var i:int=0; i<10; i++){
var newPage:Page = new Page( Orientation.PORTRAIT, Unit.MM, Size.A4 );
mPDF.addPage( newPage );
var btn:Button = new Button();
btn.label = 'Click '+i;
vbox.addChild(btn);
mPDF.addImage(vbox, 0, 0, 100, 100, ImageFormat.PNG, 100, 1,
ResizeMode.FIT_TO_PAGE );
}
var file:FileReference = new FileReference();
file.save(mPDF.save(Method.LOCAL), "Module.pdf.pdf");
}
]]>
</mx:Script>
<mx:VBox id="vbox" borderStyle="solid" borderColor="0xff00ff"/>
<mx:Button id="btn" label="CreatePDF" click="onPDFCreate()"/>
</mx:Application>
Need a quick solution...please help!!
Original comment by susrut...@gmail.com
on 3 Mar 2009 at 2:20
Original issue reported on code.google.com by
anupam.s...@gmail.com
on 22 Jul 2008 at 10:18Attachments: