AlivePDF addImage() bug yields ArgumentError: Error #2015 Invalid BitmapData
I’ve recently been using the open-source AlivePDF AS3 library to satisfy a client’s request for printing a PDF from a Flash movie. It’s a handy library–and something that would be handy to have built into Flash (then again, maybe Adobe Mars will take over).
While trying to print out a screen capture of my SWF I came across a pesky runtime error. I’ve since posted to the AlivePDF open issues list, but I figured I’d post here (below) to help further help anyone searching for the issue.
What steps will reproduce the problem?
Basically, I’ve attempted to pass a parent of a DisplayObject or variable reference to a DisplayObject instance in my class. Examples:
myPDF.addImage(this);
myPDF.addImage(MovieClip.stage);
myPDF.addImage(MovieClip.parent);
What is the expected output? What do you see instead?
I wanted to take a screen capture instance of my entire SWF, but instead I’d get the following runtime error: ArgumentError: Error #2015 Invalid BitmapData.
The problem I found was on line 3190 of org.alivepdf.pdf.PDF.as. Using FlashTracer, I determined that the following values were being passed into the addImage function:
displayObject.width:44038179.6
displayObject.height:16513228.8
When I alternatively hard code the values, the PDF prints fine:
var bitmapDataBuffer:BitmapData = new BitmapData (1000, 600, false);
What version of the product are you using? On what operating system?
I’m using AlivePDF 0.1.4.8 with Flash CS3 and TextMate on MacOSX Leopard
Visiting the New Yankee Stadium

Yankee Stadium III next to Yankee Stadium II.
Last week I took my friend Alison to what has become the annual NYC/Yankees trip. When I purchased our tickets from a season ticket-holding friend, I asked what his thoughts were on the new $1.5 billion complex. “Meh” was his response. After attending my first game there, I totally understood his reaction–and began to appreciate just how much I miss the dirty, antiquated–yet original “House that Ruth Built”.
Next to the food, of all the things I miss about big city life would be the convenience of the ballpark only a few subway stops away. I ended up going to 10-15 games a season for the past few years, so it not only became a part of city living to me, but it rekindled my interest in baseball. This time around I traded the subway for a car ride up, but the experience felt weird for reasons other than transportation.

The stadium interior
Perhaps it was the game I attended, but there was no Marlboro Man. There was no horse jockey racing his imaginary horse. I fear the Bleacher Creatures have been diluted thanks to the openness of the bleacher area, and even Freddie, who has had his problems getting in, was nowhere to be found. The grandstand felt further from the action, and the outfield display board felt distracting in all of its HD quality.
That’s not to say there weren’t things I didn’t like. For starters, I loved the return of the frieze and how the flags atop of it were ordered according to the current division standings. The seats were easily more comfortable, and the exterior limestone restored the gates to their original beauty. The Yankee Museum was a nice touch, and nearly every type of food was available (I joked at Alison about finding healthy food–only to discover a mini farmer’s market inside of Gate 4). I was also shocked–SHOCKED that they let my friend in with two bags.

The frieze returns.
One thing I do miss is the walkway circumambulating the grandstand seats. Now, one must go underneath the grandstand to walk around, and while there’s a nice balcony mid-grandstand, one wonders why they should bothering sitting in their seats when there’s a closer view at the balcony.

A comparison of old versus new hallways (old left, new on right) makes me wonder about architecture's impact on crowds.
The bottom line: this new ballpark exemplifies New York in a different manner than its predecessor, as it trades the gritty, crowded, and tradition-laden landmark with one that features excess, accessibility, and financial exclusivity. I’m sure the place will settle into my mind more after a few more games, but it’ll definitely take some getting used to.
Ronan Pictures 2.0

Personally, I REALLY dislike professional pictures (I must have been a home-staging pro in a past life, because I’m really not into littering my house with family pictures!). In this rare case I’ll give the Mrs. a pass though, cause I think the boy came out looking pretty cute. More pictures here.
Now, just don’t expect a Facebook profile for Ronan–or me swapping my profile pic with one of my kid. Yuck!
Revisiting Rome

During last month’s Central PA Tweetup I ran into a few friends that I hadn’t really seen since we were part of a group visiting Rome in 2002. The encounter reminded me of a Website of my Rome pictures I’d built shortly after the trip.
I posted the site to share the photos with friends (pre-Flickr, mind you), and I remember being scolded by people that were offended of a bunch of Penn State students hitting foreign bars so close to 9/11.
Apparently I’d taken the site down years ago, but I decided to restore it in its table layout, 800×600-supporting glory (you can check it out here).
The way I built the site and formatted the photos reminds me more of my age than any old picture of me ever would (Ugh, I’m getting old!).
About Me
I'm a designer, developer, and teacher based in Harrisburg, Pa. I run Hauck Interactive, Inc.
Categories
Archives
- January 2012
- December 2011
- October 2011
- August 2011
- July 2011
- June 2011
- May 2011
- March 2011
- February 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006
- February 2006
- January 2006
- December 2005
- November 2005
- October 2005
- September 2005
