riadvice/AlivePDF

RESIZE.FIT_TO_PAGE for bigger images

Opened this issue · 0 comments

What steps will reproduce the problem?
1. create an image bigger than the page size and transform it to b:ByteArray
2. use pdf.addImageStream(b, ColorSpace.DEVICE_RGB, new 
Resize(Mode.FIT_TO_PAGE, Position.LEFT))
3. save file fileStream.writeBytes(this.pdf.save(Method.LOCAL));

What is the expected output? What do you see instead?
image to be downsized to fit to page

What version of the product are you using? On what operating system?
rc 0.1.5

Please provide any additional information below.

case ratio > 1 should be handled in the following snippet, in the placeImage 
function:

 if ( resizeMode.mode == Mode.FIT_TO_PAGE )
            {           
                var ratio:Number = Math.min ( realWidth/image.width, realHeight/image.height );

                if ( ratio < 1 )
                {
                    width *= ratio;
                    height *= ratio;
                }
            }

Original issue reported on code.google.com by marcperm...@gmail.com on 4 Feb 2011 at 1:08