AlivePDF
AlivePDF copied to clipboard
AddImage() doesnt allow adding a display object that is created on the fly.
What steps will reproduce the problem?
1. Create a VBOX on the fly and add a button/textbox to it.
2. Now add the new vbox to addImage() method
3.
ArgumentError: Error #2015: Invalid BitmapData.
at flash.display::BitmapData/ctor()
at flash.display::BitmapData()
What is the expected output? What do you see instead?
It is expected to add the VBOX to the PDF page and save the file to local
directory.
What version of the product are you using? On what operating system?
AlivePDF 0.1.5 RC
Please provide any additional information below.
Please find code that generates the error.
private function CreatePDF():void {
generateMapSnapshot();
// print is a canvas object that has various objects and that is generated by the above method
var vBox:VBox = new VBox()
vBox.addChild(print);
var pdf:PDF = new PDF(Orientation.LANDSCAPE, Unit.MM, Size.A4);
pdf.setDisplayMode(Display.FULL_PAGE,Layout.SINGLE_PAGE);
var n:Page = new Page(Orientation.LANDSCAPE,Unit.MM,Size.A4);
pdf.addPage(n);
pdf.addImage(vBox,new Resize( Mode.FIT_TO_PAGE, Position.CENTERED),0,0,0,0,0,1,true,ImageFormat.JPG,100);
fr.save(pdf.save(Method.LOCAL),"test.pdf");
}
Original issue reported on code.google.com by [email protected] on 21 Oct 2010 at 7:47